解决Vue路由点击同一页面报错问题

技能 · 2020-07-03 · 625 人浏览
解决Vue路由点击同一页面报错问题

在路由文件里加入以下代码

const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
};
Vue Vue-Router 报错
Theme Jasmine by Kent Liao