Navigating to current location ("/aboutus") is not allowed 链接反复点击报错

 

原因:路由跳转 多次push同一个路由是不允许的

解决办法:1.vue-cli3版本 2.在设置router的js文件中重写push方法

Vue.use(VueRouter)
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}

posted on 2020-06-01 14:52  旭彬  阅读(263)  评论(0编辑  收藏  举报