且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Vue显示未转义的HTML

更新时间:2023-01-14 20:10:25

从Vue2开始,三个大括号已被弃用,你是使用 v-html

Starting with Vue2, the triple braces were deprecated, you are to use v-html.

< div v-html =task .html_content&GT; < / div>

目前还不清楚文档链接关于我们应该放在 v-html 中的内容,你的变量进入内部 v-html

It is unclear from the documentation link as to what we are supposed to place inside v-html, your variables goes inside v-html.

此外, v-html 有效仅限< div> < span> 但不包含< template>

Also, v-html works only with <div> or <span> but not with <template>.

如果您想在应用中看到这个,点击这里

If you want to see this live in an app, click here.