美文网首页
v-html无法解析后台传回的html标签

v-html无法解析后台传回的html标签

作者: 变量只提升声明不提升赋值 | 来源:发表于2020-12-16 11:54 被阅读0次
    this.msg = this.msg.replace(/&lt;/g, "<")
                .replace(/&gt;/g, ">")
                .replace(/&amp;/g, "&")
                .replace(/&quot;/g, '"')
                .replace(/&apos;/g, "'");
    

    可能是传回的html标签被转义了,把他转回来,就可以解析了

    相关文章

      网友评论

          本文标题:v-html无法解析后台传回的html标签

          本文链接:https://www.haomeiwen.com/subject/neungktx.html