[Vuejs]-Pagination is not working as expected with vue router

0👍

You will have to add a befoureRouteUpdate(to, from, next) hook in your component – or a watcher on $route. Vue-Router reuses the same component because you are not changing the route – only the query parameters.

Keep in mind that:

  1. the beforeRouteUpdate will be called only when the component is being reused – not when the route is visited for the first time (for the latter you need beforeRouteEnter)
  2. the watcher will be also called when you leave the route (e.g. if you go to clients page)

Leave a comment