Vue Avoided redundant navigation to current location Error

这个报错的根源就是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的更多相关文章
- Vue 路由跳转报错 Error: Avoided redundant navigation to current location: "/XXX".
在router文件夹下的index.js中加入红色字体代码即可解决 import Vue from 'vue' import VueRouter from 'vue-router' Vue.use(V ...
- Avoided redundant navigation to current location: "/users"
问题产生的原因:在Vue导航菜单中,重复点击一个菜单,即重复触发一个相同的路由,会报错,但不影响功能 解决:在router的配置文件中加入如下代码: const originalPush = Rout ...
- vue-router 报错、:Avoided redundant navigation to current location 错误、路由重复
在用vue-router 做单页应用的时候重复点击一个跳转的路由会出现报错 这个报错是重复路由引起的只需在注册路由组建后使用下方重写路由就可以 const originalReplace = VueR ...
- vue路由中 Navigating to current location ("/router") is not allowed
报错原因:多次点击同一路由,导致路由被多次添加 解决方法: router/index中添加以下代码: //router/index.js Vue.use(VueRouter) //导入vue路由 co ...
- C#调试含有源代码的动态链接库遇见there is no source code available for the current location提示时的解决方案
C#调试含有源代码的动态链接库遇见there is no source code available for the current location提示时的解决方案: 1.首先试最常规的方法:Cle ...
- 解决vue项目路由出现message: "Navigating to current location (XXX) is not allowed"的问题(点击多次跳转)
如果网页跳转用的方法传参去跳转: (点击多次链接会出现错误) <a class="" href="javascript:void(0);" @click= ...
- 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 ...
- 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 ...
- Vue热更新报错(log.error('[WDS] Errors while compiling. Reload prevented.'))
log.error('[WDS] Errors while compiling. Reload prevented.');中的WDS其实是webpack-dev-serverwebpack的意思,用来 ...
随机推荐
- 面试题(造火箭必备技能):请举例一个最有成就感的性能bug
当前,绝大部分招聘都有性能要求或者把其作为加分项(会性能优先),哪怕你不是面试的性能,面试的时候可能会问性能,所以大家才会有"面试造火箭,进去拧螺丝"的共鸣.至于企业为什么重视性能 ...
- Tabluea、Smartbi可视化仪表盘创建流程图分享
你知道Tableau.Smartbi在可视化仪表盘制作步骤上有何差异吗?下面一起来了解吧~ 根据上面的流程图我们可以了解到,不同于Smartbi是在同一界面即可完成的,Tableau是由很多个工作表组 ...
- 移动BI,移动报表平台
随着大数据时代的到来,随着商业智能衍生出来的移动BI也将处于一片大好的形式中,由于智能手机.移动应用的普及,越来越多的办公软件均已支持了移动办公,这也给移动BI带来了更多的想象,通过一部手机就可以随 ...
- BI企服界大众点评来袭!Smartbi入围36氪企服软件系列三大榜单!
近日,36氪企服点评中国商业智能BI金榜揭晓.作为国产民族BI软件的领跑者,思迈特软件凭借深耕多年大数据BI领域中拥有过硬的产品实力与优质的服务,荣获"商业智能BI最佳软件总榜TOP10&q ...
- C语言qsort()函数的使用
C语言qsort()函数的使用 qsort()函数是 C 库中实现的快速排序算法,包含在 stdlib.h 头文件中,其时间复杂度为 O(nlogn).函数原型如下: void qsort(void ...
- 通过xmanager连接linux远程主机桌面
转至:https://blog.csdn.net/kadwf123/article/details/79564293 1.效果图: 远程linux桌面版主机,此处是虚拟机: 使用xmanager xb ...
- Java课程设计---代码及数据库
点击下载: 代码:StudentSystem 数据库名:db_student 数据表:tb_student tb_class admin
- 7.Flink实时项目之独立访客开发
1.架构说明 在上6节当中,我们已经完成了从ods层到dwd层的转换,包括日志数据和业务数据,下面我们开始做dwm层的任务. DWM 层主要服务 DWS,因为部分需求直接从 DWD 层到DWS 层中间 ...
- Qt:QJsonArray
0.说明 QJsonArray中存储了一系列的QJsonValue.可以向其中插入.删除QJsonValue. 一个QJsonArray可以与QVariantList互相转换.可以通过size()访问 ...
- WPS:公式在中间,编号靠右
1.新建表格1*3 2.在中间单元格内输入公式,在右边单元格中输入编号 3.在"开始"菜单栏找到"居中"和"靠右"两个按钮,给中间单元格设置 ...