原因:路由中添加了相同的路由。
解决:
在src/router/index.js 里面重写路由push方法
/**
* 重写路由的push方法
*/
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}
原因:路由中添加了相同的路由。
解决:
在src/router/index.js 里面重写路由push方法
/**
* 重写路由的push方法
*/
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}