解决思路 重写push方法,添加catch

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}

解决vueRouter 跳转相同路由报错

 

相关文章:

  • 2021-05-19
  • 2021-11-28
  • 2021-12-28
  • 2021-05-12
  • 2021-11-28
  • 2021-11-28
  • 2021-09-30
  • 2021-06-24
猜你喜欢
  • 2021-06-13
  • 2021-11-28
  • 2021-04-23
  • 2021-11-28
  • 2021-11-28
  • 2021-11-28
  • 2021-06-18
  • 2021-11-28
相关资源
相似解决方案