HTML interpolations {{{foo}}} have been removed in favor of the v-html directive in vuejs2.X , so from version 2.x Vue.js allows you to use JavaScript templates (React Style) in addition to HTML templates.
@Jeff's answer is correct, but for versions of vuejs 1.x, but in case {{{}}} didn’t work for you guys, or if you want to evaluate tags in HTML and from a reliable source, for example, if you want to add <strong></strong> , then you need to use v-html, v-html to ask Vue to evaluate the string as HTML:
<span v-html="$options.filters.highlight(item, val)">{{ item }}</span>
highlight filter:
Vue.filter('highlight', function(word, query){ var check = new RegExp(query, "ig"); return word.toString().replace(check, function(matchedText,a,b){ return ('<strong>' + matchedText + '</strong>'); }); });
or you can use the @Thomas Ferro filter
Kumar_14
source share