I need help writing a text highlight filter using vuejs. The idea is to loop through a given array of words and if there is a match, apply a span with a class to that word. The problem I have is that, I can't seem to return data with html formatting with vuejs. Any ideas will be highly appreciated. I am really stuck with this.
Vue.filter('highlight', function(words, query){
//loop through **words** and if there is a match in **query**
//apply a <span> with some style
//At the end return formatted string to html page
})