解决vue-router报NavigationDuplicated: Avoided redundant navigation to current locat

181 阅读1分钟

只需要在router /index的页面里面 加入

const originalPush = VueRouter.prototype.push

VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

image.png 这样就不会出现报错了