首页 > 解决方案 > 将 href 与 span 标签连接起来

问题描述

我想知道如何将 href 标签与 span 连接起来,因为要生成的链接是连接这两个标签的结果

<a href='first part of link&amp;mount=&amp;'> 
<span t-field="Second part of link" t-field-options="{'widget':'False'}"/>Clic here
</a> 

标签: xmlxpathodooodoo-10qweb

解决方案


您不需要为此使用跨度来构建属性值。您可以使用 QWeb 属性格式来生成如下输出:

<a t-attf-href="{{base_url}}?mount={{amount_value}}">Clic here</a> 

您可以在以下位置阅读有关它的信息:

https://www.odoo.com/documentation/11.0/reference/qweb.html#attributes


推荐阅读