Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.

简介: Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.


这个错误提示是Vue Router抛出的,意思是你尝试导航到当前路由,这会被视为冗余操作。


在代码中,可能是因为多次点击了同一个导航链接或按钮,或者使用编程方式进行了重复导航操作,从而导致了这个错误。请检查你的代码,并确保在进行导航操作时不会重复导航到相同的路由地址。



解决方案1:删除导航当前路由代码


解决方案2:如果你使用的是Vue Router 3.x版本,你可以通过在router/index.js文件中添加下面的代码来禁用重复导航报错


const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err);
}


相关文章
|
7月前
|
编解码 数据处理
|
7月前
|
缓存 IDE Linux
Internal error. Please report to https://jb.gg/ide/critical-startup-errors
Internal error. Please report to https://jb.gg/ide/critical-startup-errors
145 0
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
131 0
|
关系型数据库 MySQL C++
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
191 0
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
146 0
Dx unsupported class file version 52.0 Conversion to Dalvik format failed with error 1
Dx unsupported class file version 52.0 Conversion to Dalvik format failed with error 1
154 0
|
计算机视觉
opencv出错:error: (-213:The function/feature is not implemented) Unknown/unsupported array type
opencv出错:error: (-213:The function/feature is not implemented) Unknown/unsupported array type
482 0
|
网络协议 关系型数据库 Linux
onfigure: error: no acceptable C compiler found in $PATH See `config.log' for more details 问题解决
onfigure: error: no acceptable C compiler found in $PATH See `config.log' for more details 问题解决
190 0
|
Web App开发 Java
错误:Reference file contains errors http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsdv......
引用:http://topic.csdn.net/u/20070125/18/8d676afd-868a-4c2d-9a1b-07eed6b5683d.html   6楼 xsi:schemaLocation= "http://java.
1548 0
下一篇
DataWorks