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