这个报错的根源就是vue-router组件,错误内容翻译一下是: Avoided redundant navigation to current location === 避免冗余导航到当前位置

这个问题的解决方案就是屏蔽它,就是重写vue-router的push方法,不影响正常使用

在 Vue.use(VueRouter的时候),前面加上这一句即可

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

主要的作用就是把err给屏蔽了,不进行输出了,页面看不到这个错误,但是不影响使用

Vue Avoided redundant navigation to current location Error的更多相关文章

  1. Vue 路由跳转报错 Error: Avoided redundant navigation to current location: "/XXX".

    在router文件夹下的index.js中加入红色字体代码即可解决 import Vue from 'vue' import VueRouter from 'vue-router' Vue.use(V ...

  2. Avoided redundant navigation to current location: "/users"

    问题产生的原因:在Vue导航菜单中,重复点击一个菜单,即重复触发一个相同的路由,会报错,但不影响功能 解决:在router的配置文件中加入如下代码: const originalPush = Rout ...

  3. vue-router 报错、:Avoided redundant navigation to current location 错误、路由重复

    在用vue-router 做单页应用的时候重复点击一个跳转的路由会出现报错 这个报错是重复路由引起的只需在注册路由组建后使用下方重写路由就可以 const originalReplace = VueR ...

  4. vue路由中 Navigating to current location ("/router") is not allowed

    报错原因:多次点击同一路由,导致路由被多次添加 解决方法: router/index中添加以下代码: //router/index.js Vue.use(VueRouter) //导入vue路由 co ...

  5. C#调试含有源代码的动态链接库遇见there is no source code available for the current location提示时的解决方案

    C#调试含有源代码的动态链接库遇见there is no source code available for the current location提示时的解决方案: 1.首先试最常规的方法:Cle ...

  6. 解决vue项目路由出现message: "Navigating to current location (XXX) is not allowed"的问题(点击多次跳转)

    如果网页跳转用的方法传参去跳转: (点击多次链接会出现错误) <a class="" href="javascript:void(0);" @click= ...

  7. vue.js报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.

    ERROR Failed to compile with 2 errors 12:00:33 error in ./src/App.vue Module build failed: Error: No ...

  8. Vue使用Typescript开发编译时提示“ERROR in ./src/main.ts Module build failed: TypeError: Cannot read property 'afterCompile' of undefined”的解决方法

    使用Typescript开发Vue,一切准备就绪.但npm start 时,提示“ ERROR in ./src/main.tsModule build failed: TypeError: Cann ...

  9. Vue热更新报错(log.error('[WDS] Errors while compiling. Reload prevented.'))

    log.error('[WDS] Errors while compiling. Reload prevented.');中的WDS其实是webpack-dev-serverwebpack的意思,用来 ...

随机推荐

  1. SUSCTF2022 Misc-AUDIO&RA2

    前言:这次参加了susctf感受颇深,题目难度不是很大很大,但是很考验基础的技术熟练度,比如re这次就因为不会套脚本去解密,导致卡死在了第一道题,一道没做出来.所以只做了做misc和web. RA2 ...

  2. C# 重载运算符--不合理设计,只支持静态

    什么叫做重载运算符 比如:int x=1; int y=2; int total=x+y; 我们比较喜欢看上面这种写法,而不是这种, int x=1; int y=1; int total=int.a ...

  3. python爬虫之抓取小说(逆天邪神)

    2022-03-06 23:05:11 申明:自我娱乐,对自我学习过程的总结. 正文: 环境: 系统:win10, python版本:python3.10.2, 工具:pycharm. 项目目标: 实 ...

  4. Chrome:开发者模式下复制Element下的代码

    Element模块下的代码只能一行一行复制,想要复制一个代码块,可以把该代码块先收起来,再对这个收起来的代码块进行复制就OK了

  5. c++刷leetcode记录

    #include<iostream> #include<sstream> #include<vector> std::vector<int> split ...

  6. Centos部署Loki日志聚合系统

    关于一些日志聚合由来及原理科普见我的另外一篇 <编程入门之日志聚合系统> https://www.cnblogs.com/uncleguo/p/15948763.html Loki日志聚合 ...

  7. 树莓派4B安装 百度飞桨paddlelite 做视频检测 (一、环境安装)

    前言: 当前准备重新在树莓派4B8G 上面搭载训练模型进行识别检测,训练采用了百度飞桨的PaddleX再也不用为训练部署环境各种报错发愁了,推荐大家使用. 关于在树莓派4B上面paddlelite的文 ...

  8. C#控制打印机打印

    一.引用BarcodeStandard.dll #region BarcodeStandard.dll /* * * 使用说明 需要通过NuGet进行安装BarcodeLib.dll,必不可少 */ ...

  9. VirtualBox虚拟机-安装增强功能

    virtualbox中win10虚拟机怎么安装增强功能 安装VBoxGuestAdditions增强功能后,可增加以下功能: 鼠标集成: 可以无缝的在宿主机与虚拟机之间移动鼠标. 自适应窗口:可以任意 ...

  10. WPF界面语言切换

    举例中英文切换: 一.静态切换(每次切换需要重启应用) 1. 新建一个WPF APP(.NET Framework)项目,StaticLanguageSelect 2. 右击项目名,添加New Ite ...