解决 NavigationDuplicated: Avoided redundant navigation to current location: “/“

简介: 解决 NavigationDuplicated: Avoided redundant navigation to current location: “/“
  • Vue 中路由报错 NavigationDuplicated: Avoided redundant navigation to current location: "/",原因是路由重复。

  • 解决方案
    router 文件夹下的 index.js 中加入下面代码,解决!
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
相关文章
|
8月前
|
小程序 JavaScript
Avoid mutating a prop directly since the value will be overwritten whenever the parent comp
Avoid mutating a prop directly since the value will be overwritten whenever the parent comp
|
JavaScript
vue项目router报NavigationDuplicated: Avoided redundant navigation to current location: “/result/3“错误
vue项目router报NavigationDuplicated: Avoided redundant navigation to current location: “/result/3“错误
67 0
vue项目router报NavigationDuplicated: Avoided redundant navigation to current location: “/result/3“错误
|
JavaScript
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
217 0
|
JavaScript
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent .(二)
1.在data中声明一个变量接收props的值,然后再去改变data里的这个值 2. 用computed属性 3.用data保存数据,watch监听
113 0
|
JavaScript
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent .(一)
大致意思就是props接收到的从父组件传过来的tableData不能直接修改。
164 0
DT Slate Brush Browser Plug -in description
DT Slate Brush Browser Plug -in description
77 0
|
JavaScript 算法 前端开发
Property xxx was accessed during render but is not defined on instance
目前el-form的model主要用表单验证的,也就是配合el-form的rules和el-form-item的prop来使用的。不信的话,你可以增加一个rules和prop(为了调用验证方法,也el-form也加一个ref属性,相当于id或者class选择器的意思),但是不写model,然后验证的话,会提示缺少model,导致无法验证成功。
Property xxx was accessed during render but is not defined on instance
MGA (Managed Global Area) Reference Note (Doc ID 2638904.1)
MGA (Managed Global Area) Reference Note (Doc ID 2638904.1)
346 0
The href attribute requires a valid value to be accessible
The href attribute requires a valid value to be accessible
242 0
- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as t
vue.js报错如下: - Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as , as they will not be parsed.
5664 1