原因:是指路由重复。
虽然对项目无影响,但是看到有红的不舒服!
解决方法:
打开router文件夹下的index.js文件中添加如下代码:
添加下面代码即可解决报错问题
//获取原型对象上的push函数
const originalPush = VueRouter.prototype.push
//修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}