解决vueRouter 跳转相同路由报错

解决思路 重写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)
}

原文地址:https://www.cnblogs.com/binglove/p/13570021.html