解决思路 重写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 跳转相同路由报错

 

相关文章:

  • 2022-12-23
  • 2021-08-17
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-11-01
猜你喜欢
  • 2022-12-23
  • 2021-06-15
  • 2021-03-03
  • 2022-12-23
  • 2023-04-05
  • 2023-04-05
  • 2022-12-23
相关资源
相似解决方案