Avoided redundant navigation to current location:
出现情况:
*1.*在当使用element的el-menu时,如果没有给index路径,便会出现
*2.*另外一种情况就是,路由重复
解决办法是在router =》 的index.js 文件下
加入:
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
或者
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
return originalReplace.call(this, location).catch(err => err);
}