[英]How to get mixed text from v-html with unrendered tags and rendered tags
我從 elasticsearch 收到一條文本,這是一些用 '' 包圍的關鍵字,還有一些標簽應該只顯示例如:原始文本:"/DocumentCMBCCNXXX" 渲染文本:"/DocumentCMBCCNXXX";CMBCCNXXX 顯示為紅色期望文本:" /DocumentCMBCCNXXX ";CMBCCNXXX 顯示為紅色
期望 v-html 僅將標簽呈現為 html
解決:
content.replace(/</g,"<").replace(/>/g,">").replace("<span style='color:red'>","<span style='color:red'").replace("</span≥","</span>")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.