问题描述
在进行路由跳转时,点击多次出现以下错误
解决方案
将以下代码放在路由配置文件index.js中即可
// 解决同一页面产生导航冗余,vue-router报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
或者在路由跳转位置捕获一下错误 不处理