the requirement is that the AutoComplete component of Vue input abc will go to the background to take out all the existing abc (case-insensitive) and highlight
highlightData: function (data, propShow, propOrigin, highlight) {
data.forEach(item => {
//
let replaceReg = new RegExp(highlight, "gi")
// v-html
let replaceString = "<span class="color-primary">" + highlight + "</span>"
//
item[propShow] = item[propOrigin].replace(replaceReg, replaceString)
})
return data
},
that"s what I wrote before, but it turns the original ABC into abc and highlights it. It"s hard? How to write