问题原因: 同一个路由多次添加不被允许
解决方法:
//import VueRouter from 'vue-router' 引入的vue-router
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(to) {
return VueRouterPush.call(this, to).catch(err=> err)
}
问题原因: 同一个路由多次添加不被允许
解决方法:
//import VueRouter from 'vue-router' 引入的vue-router
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(to) {
return VueRouterPush.call(this, to).catch(err=> err)
}