Hi,
I am using vue router with history mode. I have a search implemented with this URI: /search?q=one
To execute the search, a separate components does:
this.$router.push({
name: 'search',
query: {
q: this.searchInput
}
});
On the search results component, I load the search results on mounted()
, but when a new search is performed (URL changes to /search?q=two
) nothing changes on the component. I can see that the search is actually performed, on chrome developers tool, but the VUE data property results
is not updated.
mounted() {
this.isLoading = true;
api.ListEvents({
q: this.$route.query.q
}).then((res) => {
this.results = res.events;
this.isLoading = false;
}).catch(() => {
this.isLoading = false;
});
}
None of the data properties are updating on the search result component according to vue dev tools.
If I navigate away from research results and perform a search, the results do get updated.