现象:
解决方法:打开router文件夹下的index.js文件中添加如下代码
push方法的

//获取原型对象上的push函数const originalPush = Router.prototype.push//修改原型对象中的push方法Router.prototype.push = function push(location) {return originalPush.call(this, location).catch(err => err)}
replace方法的

const originalPush = VueRouter.prototype.replace//修改原型对象中的push方法VueRouter.prototype.replace = function push(location) {return originalPush.call(this, location).catch(err => err)}

