[Vuejs]-Router.push() doesn't reload router-view in VUE

0👍

Interesting thing:
Here we can find implementation of beforeEach and i used them. And it does’t solve my problem.

I moved last next() form else to the ond of labmda and it works.

// fragmet from docs
router.beforeEach((to, from, next) => {
  if (...) {
    // this was unnecessary for this explanation
  } else {
    next() // make sure to always call next()!
  }
})
// fragmet from my code
router.beforeEach((to, from, next) => {
  if (...) {
    // this was unnecessary for this explanation
  }
  // I removed `else` node for last `next()` call
  next() // make sure to always call next()!
})

Anyway, please tell me why it doesn’t worke when nextis in else

Leave a comment