vue中处理后台返回的html特殊标签(‘lt;pstyle=“xxx“gt;‘)或(<p。。。.pdfVIP

  • 3
  • 0
  • 约小于1千字
  • 约 1页
  • 2023-03-21 发布于上海
  • 举报

vue中处理后台返回的html特殊标签(‘lt;pstyle=“xxx“gt;‘)或(<p。。。.pdf

vue 中处理后台返回的html特殊标签(‘lt ;pstyle=“xxx“gt;‘)或(<p。。。 问题⼀:vue 中处理后台返回的 html 特殊标签(‘lt ; p style=“xxx“ gt ;‘)或(\<p >)的三种情况 返回数据 // 返回数据: list: { introduct: lt;p style=color: lightcoral;gt;就nbsp;当⽂字就是内容吧。lt;/pgt;, } // 或者 list: { introduct: span style=color: skyblue就当⽂字就是内容吧。nbsp;/p, } 解决⽅案: var arrEntities = { lt: , gt: , nbsp: , amp: , quot: }; return str.replace(/(lt|gt|nbsp|amp|quot);/ig, function(all, t) { return arrEntities[t]; }); 问题⼆

文档评论(0)

1亿VIP精品文档

相关文档