用的vue2,在点击按钮跳转路径的时候发现,多次点击同一路径的按钮的时候,控制台会报错
需要在router.js文件中!!!一定注意不是在main.js中添加这些代码
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
return originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)