admin管理员组

文章数量:1612099

报错显示路由重复,对功能没有影响,可是强迫症看着不爽

具体表现: 重复点击 elementui 中 tab 栏菜单,会报这种错误。

解决方案:

// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

router 文件下 index.js 中添加上面代码即可。
注意:Router还是VueRouter取决于你文件中的定义。

本文标签: 报错解决方案项目Errorvue