如何防止“t-out”转义我的 Html 代码?

问题描述 投票:0回答:1

如何防止

t-out
转义我的Html代码?

我正在尝试在我的网站上显示一个 Html 代码。在旧的 Odoo 版本中,我使用

t-raw
并且效果很好。现在在 Odoo 16 中,
t-raw
已被弃用,
t-out
是要走的路。但是
t-out
总是转义我的代码并在我的网站上将其显示为文本。

这是我的旧代码

t-raw

<div class="row">
    ​<t t-raw="html_output"/>
</div>

这是我的新代码

t-out

<div class="row">
    ​<t t-out="html_output"/>
</div>

This is what it should look like

And this is what it's showing

如何阻止

t-out
转义我的 Html 代码?

odoo qweb odoo-16
1个回答
-2
投票

也许你找到了解决这个问题的方法?我面临着非常相似的情况,只是在 POS 中,想要将一些 HTML 代码添加到收据中,但它被转义了。已尝试使用文档中的建议,但它不起作用。你检查过这部分了吗?https://www.odoo.com/documentation/16.0/developer/reference/frontend/qweb.html#advanced-output

© www.soinside.com 2019 - 2024. All rights reserved.