[Vuejs]-Dynamic query in Vue Router gives an error

0👍

Likely you try to redirect to the same page. To prevent this try something like this

let selected = this.currentPage;
if (selected !== this.$route.query.page)
  this.$router.replace({name: '', query: {...this.$route.query, page: selected }});

Leave a comment