I want to render that HTML content into options list so need help in resolving this issue.
HTML
<Multiselect
v-model="radiologyTests"
mode="tags"
placeholder="Choose your stack"
:close-on-select="false"
:filter-results="true"
:min-chars="1"
:resolve-on-load="false"
:delay="0"
:searchable="true"
:options="async function(query) {
return await fetchLanguages(query) // check JS block for implementation
}">
</Multiselect>
Method
async fetchLanguages(query){
var resData = [];
await axios.post(this.route("searchRadiologyTests"),{search:query}).then(function(response){
for( var i in response.data){
resData.push(response.data[i]);
}
});
console.log(resData);
return resData.map((item) => {
item.test_name.replace(new RegExp(query, "gi"), (match) => `<span style='color:red'>${match}</span>`)
return { value: item.id, label:item.test_name }
})
},
Any help will be highly appreciable. Thanks