highlight(keyWords, resultsList) { if (keyWords && keyWords.length > 0) { // 匹配关键字正则 let replaceReg = new RegExp(keyWords, 'g') // 高亮替换v-html值 let replaceString = '<span style="color:#F74C31">' + keyWords + '</span>' resultsList = resultsList.replace(replaceReg, replaceString) } return resultsList }