Vue 项目中路由重复点击报错

263 阅读1分钟

路由重复点击报错

在router/index.js中添加

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