I have a search page with a text box and search button.
I implemented a facet using Vue.js. Initially, everything works fine when I search for something. However, after typing a new text and searching again, the facet does not update with the new values.
I attempted to resolve this by following a guide at , but I was unsuccessful.
Can anyone help me with this issue?
function UpdateFacetSiteSearch(resultsFacet) {
new Vue({
el: '#facets',
data() {
return {
facets: resultsFacet.Facets,
totalresults: resultsFacet.TotalNumberOfResults
}
}
});
}
UpdateFacetSiteSearch(results); => I invoke this function every time I search for a new text.
<div class="search-filter-container" id="facets" v-if="totalresults > 0">
<div class="links-container">
<a href="#" v-for="item in facets" onclick="CallSearchFacet(this)" :result-field-name="item.Item1" :result-count="item.Item2">{{ item.Item1 }} ({{ item.Item2 }})</a>
</div>
</div>