解决vue-router报NavigationDuplicated: Avoided redundant navigation to current location: “/login“ 的问题
一、普遍问题解决方法
import Router from 'vue-router';
Vue.use(Router);
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.pushRouter.prototype.push = function push(location) {return originalPush.call(this, location).catch(err => err)
}
二、如果方法一的代码已添加,但不生效,可检查代码中是否重复指定跳转了同一路由
handleLogOut () {this.logout();// this.$router.replace('/login'); // 退出登录方法已经退出了当前路由,又手动指定了路由,所以提示重复路由},
解决vue-router报NavigationDuplicated: Avoided redundant navigation to current location: “/login“ 的问题相关推荐
- vue 跳转报 NavigationDuplicated: Avoided redundant navigation to current location: “/to-do“.
错误提示:NavigationDuplicated: Avoided redundant navigation to current location: "/to-do". 提示这 ...
- 解决Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location问题
在Vue路由中遇到Error: Avoided redundant navigation to current location:xxxx:错误,意思是路由重复 在router文件夹下的index.j ...
- 报错:Avoided redundant navigation to current location: “/login“.完美解决
需求: 登陆之后才能查看主页面,否则跳转至登录页 遇到的问题: 一开始是打算直接在拦截器跳转路由的,发现会报错Avoided redundant navigation to current locat ...
- 解决Vue报错:Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
问题描述:重复点击导航时,控制台出现报错 ,虽然不影响功能使用,但也不能坐视不管. 解决 Vue 重复点击相同路由,出现 Uncaught (in promise) NavigationDuplica ...
- 解决报错:Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “
报错内容: vue-router.esm.js?68cf:2065 Uncaught (in promise) NavigationDuplicated: Avoided redundant navi ...
- vue报错 Avoided redundant navigation to current location: “/search“
报错信息: Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: ...
- vue2里面的Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
编程式导航跳转到当前路由(参数不变),多次执行就会在控制台出现如下结果: 怎么解决: (1)最有效--重写push.replace 在router-index.js中添加: // 重写push.rep ...
- Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/deta
Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: " ...
- vue重复点击路由报错,解决NavigationDuplicated: Avoided redundant navigation to current location: 问题
vue项目中重复加载当前路由会报错, 解决方法:找到项目中的router文件,在里面添加代码,修正Vue原型上的push和replace方法 (注意vue-router的引入名称) // 缓存原型上的 ...
最新文章
- applet操作本地文件
- 为什么说“人生苦短,我用Python”?为什么Python这么火?
- Android 把第三方jar 打进java包
- bzoj 1095 捉迷藏
- Android中动态获取Drawable中的图片
- 移动端开发—流式布局
- FFmpeg h264转h265命令(九)
- easyui图标对照 --由于文章历史久远, 博主放弃治疗了
- 云服务器对比虚拟主机,云服务器对比虚拟主机
- abc能否构成三角形c语言,编写程序输入三角形三边a.b.c 判断abc能否构成三角形...
- 在市场买一个小鸡都要20多块,为什么加工好的童子鸡才19块?
- 分数段统计函数c语言,Excel 五个函数统计学生期末考试分数段
- java技能要求_Java工程师需要具备的25个技能
- 微信小程序如何设置背景图片
- vue+mysql实现前端对接数据库
- svn恢复到指定版本
- 【2020.12】Aspose.words 20.12最新版Crack,word转pdf去水印方法
- 23中北大学计算机/软件考研必知
- SML-Rangelab
- html中input标签中type属性小总(包含html5新增表单属性)