0
点赞
收藏
分享

微信扫一扫

vue项目报错,NavigationDuplicated

鱼板番茄 2022-02-22 阅读 51

问题

vue项目报错,NavigationDuplicated

{
    "_name": "NavigationDuplicated",
    "name": "NavigationDuplicated",
    "message": "Navigating to current location (\"/user\") is not allowed"
}

在这里插入图片描述

解决方案

重写路由

const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error)
}

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

举报

相关推荐

0 条评论