出现的错误:
出现这个错误的原因是,在路由跳转的时候两次push的path地址相同
解决方法两种:
1.切换版本回3.0版本
2.在你引了vue-router的js文件里加上如下代码即可
/**
* 重写路由的push方法
*/
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}