记录一下 vue-router 点击重复报错问题

184 阅读1分钟

在 js 中加入

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