<div v-html="redStr"></div>
// 例如:需要标红的的词组
const arr = ['毒', '罂粟', '爹', '罪', '派出所', '转让', '贱内', '妻', 'love', '媽媽', 'mama', 'baba', 'dad', 'mom']
arr.forEach(item => {
let regex = RegExp('(' + item.replace('\\$1') + ')', 'ig')
let html = '<span style="color:red">$1</span>'
this.redStr = this.redStr.replace(regex, html)
})
效果如下: