【问题标题】:Concatenate href with a span tag将 href 与 span 标签连接起来
【发布时间】:2018-10-12 02:55:11
【问题描述】:

我想知道如何将 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> 

【问题讨论】:

  • 为什么?通过提供所需信息正确询问
  • 你好@Axel Mendoza,我正在修改 odoo 报告 10 我有一个在线支付服务,它包含一个固定的 url [href] **+ 一个数字(这是在线支付的金额由客户端)**[span],这两个元素的并集就是客户端必须点击支付的url。

标签: xml xpath odoo odoo-10 qweb


【解决方案1】:

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

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

您可以在以下位置阅读:

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

【讨论】:

  • 谢谢@Axel Mendoza,可以将 &doc.amount_total" t-field-options="{'widget':'False'} 放入 { {数量价值}}?我试过这样做,但它不起作用
  • 你可以只放{{doc.amount_total}},不需要放optionst-field
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-07-26
  • 2015-04-12
  • 1970-01-01
  • 2021-09-14
  • 2022-10-31
  • 2013-09-05
  • 1970-01-01
相关资源
最近更新 更多