首页 > 其他 > 详细

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

时间:2020-06-01 15:55:45      阅读:35      评论:0      收藏:0      [点我收藏+]

 

原因:路由跳转 多次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)
}

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

原文:https://www.cnblogs.com/MXubin/p/13025182.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!