
以上的那种错误,就是当重复点击一个路由的时候,报出这种错误;
修复方法:在router.js中添加这一段代码就好啦;
因为这是重写路由的push方法---->这个是vue-cli4.x以上的坑
const originalPush = VueRouter.prototype.push VueRouter.prototype.push = function(location, onResolve, onReject) { if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) return originalPush.call(this, location).catch(err => err) }
浙公网安备 33010602011771号