I have a function that returns HTML code.
renderSuggestion(suggestion) {
const query = this.query;
if (suggestion.name === "hotels") {
const image = suggestion.item;
return this.$createElement('div', image.title);
} else {
let str = suggestion.item.name;
let substr = query;
return this.$createElement('div', str.replace(substr, `<b>${substr}</b>`));
}
},
However, the <b>
element is not rendering as an HTML element in the browser. It is being displayed as a string... How can I make sure the <b>
element is displayed correctly?
Thank you