它的提示是 避免到當前位置的冗余導航。就是重復觸發了同一個路由。
報錯顯示路由重復,對功能沒有影響。
解決方法
router 文件下添加下面代碼即可
// 解決ElementUI導航欄中的vue-router在3.0版本以上重復點菜單報錯問題
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}