JavaScript/vue.js/正则插入html标签
来自康健生活
< JavaScript | vue.js
引言
<span v-html="item.summary.slice(0,50).replace(new RegExp(this.$route.query.q,'ig'), '<span class=textLight >$&'+'</span >')"></span>
No categories
<span v-html="item.summary.slice(0,50).replace(new RegExp(this.$route.query.q,'ig'), '<span class=textLight >$&'+'</span >')"></span>
No categories