简体   繁体   中英

How to get mixed text from v-html with unrendered tags and rendered tags

I get a text from elasticsearch,this is some keyword be surrounded with '', also some tags should only be displyed formexample: original text:"/DocumentCMBCCNXXX" rendered text: "/DocumentCMBCCNXXX";CMBCCNXXX displayed with red color expect text: "/DocumentCMBCCNXXX ";CMBCCNXXX displayed with red color

expect v-html only render tag- to html

resolved:

content.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace("&lt;span style='color:red'&gt;","<span style='color:red'").replace("&lt;/span&ge;","</span>")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM