鱼板番茄

关注

vue项目报错,NavigationDuplicated

鱼板番茄

关注

阅读 51

2022-02-22

问题

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)
}

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

相关推荐

金牛豆豆

前端:Vue路由导航报错:NavigationDuplicated: Avoided redundant navigation to current location解决方法

金牛豆豆 62 0 0

萨科潘

nginx部署vue项目报错

萨科潘 89 0 0

Java旺

vue init webpack 建vue项目报错

Java旺 88 0 0

在觉

vue router: NavigationDuplicated: Avoided redundant navigation to current location: "/template"

在觉 67 0 0

Android开发指南

vue 项目 get 请求报错404

Android开发指南 71 0 0

Silence潇湘夜雨

vue项目安装vuex报错:Object(...) is not a function“

Silence潇湘夜雨 135 0 0

潇湘落木life

vue项目打包,内存溢出报错

潇湘落木life 83 0 0

at小涛

node版本升级后(vue)项目运行报错

at小涛 130 0 0

芒果六斤半

vue项目报错 Navigating to current location (XXX) is not allowed

芒果六斤半 121 0 0

圣杰

Vue项目报错:Uncaught (in promise) Error Network Error

圣杰 97 0 0

精彩评论(0)

0 0 举报