vue 出现 Avoided redundant navigation to current location: “*****“
vue 中重复点击菜单报Avoided redundant navigation to current location: “*****”
虽然对项目无影响,但是强迫症的我看了还是很变扭
解决方法:
1.找到router文件夹下的index.js文件
2.在index.js中加下面的代码
import Router from ‘vue-router’
//解决重复点菜单报红问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
3.点击保存就可以了