在router.js中加入以下代码就可以

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

如果你的改了push还是没有生效,修改路由replace方法,阻止重复点击报错

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

Uncaught (in promise) Error: Avoided redundant navigation to current location: “/index“. 解决方法相关推荐

  1. vue-router.esm.js?fe87:2062 Uncaught (in promise) Error: Avoided redundant navigation to current loc

    vue报错 vue-router.esm.js?fe87:2062 Uncaught (in promise) Error: Avoided redundant navigation to curre ...

  2. 解决Vue报错:Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location

    问题描述:重复点击导航时,控制台出现报错 ,虽然不影响功能使用,但也不能坐视不管. 解决 Vue 重复点击相同路由,出现 Uncaught (in promise) NavigationDuplica ...

  3. 解决报错:Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “

    报错内容: vue-router.esm.js?68cf:2065 Uncaught (in promise) NavigationDuplicated: Avoided redundant navi ...

  4. vue2里面的Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location

    编程式导航跳转到当前路由(参数不变),多次执行就会在控制台出现如下结果: 怎么解决: (1)最有效--重写push.replace 在router-index.js中添加: // 重写push.rep ...

  5. Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/deta

    Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: " ...

  6. 解决Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location问题

    在Vue路由中遇到Error: Avoided redundant navigation to current location:xxxx:错误,意思是路由重复 在router文件夹下的index.j ...

  7. Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/sear

    1). 问题: 编程式路由跳转到当前路径且参数没有变化时会抛出 NavigationDuplicated 错误 2). 原因分析: vue-router3.1.0之后, 引入了push()的promi ...

  8. Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/zhu“

    错误原因:避免重复导航到当前路径 <template><div><input type="text" placeholder="搜索&quo ...

  9. vue-router 报错Error: Avoided redundant navigation to current location: “/index/user“解决方式

    问题 使用ivew Menu 制作的导航菜单,连续点击同一个导航时报错 该报错不影响功能 当前地址 http://localhost:8080/#/transfer/index 连续点击–信息录入 报 ...

最新文章

  1. stm32 GPIO的8种工作模式
  2. 总结基于ArcGIS Server 9.2 Dot Net ADF的WebGIS项目部署问题
  3. 【解决方案】OpenCV配置【Win10+VS2017】(本人于2018年3月30日完成)
  4. Springboot .properties或.yml配置文件读取pom.xml文件值
  5. BZOJ 1051 受欢迎的牛(Tarjan缩点)
  6. 【编译原理】语言的定义
  7. Deltix Round, Spring 2021 (open for everyone, rated, Div. 1 + Div. 2)
  8. 【ubuntu】ubuntu下用make编译程序报错找不到openssl/conf.h
  9. docker run 挂载卷_docker mysql配置挂载到卷
  10. CSS 盒倒影 box-reflect属性
  11. 【Struts1.2总结系列】struts-config.xml配置
  12. springboot15 集成Druid(德鲁伊)
  13. mysql连网安装和断网安装的区别_Linux 断网安装MySQL5.x操作步骤
  14. PS一键磨皮美白扩展插件Delicious Retouch 5.0 汉化集合版 Win/Mac
  15. 验证哥德巴赫猜想php,庞加莱猜想告破
  16. 计算机管理为什么不能扩展卷,Win10 C盘不能扩展卷怎么解决?
  17. python实现百度语音合成(超详细!!)
  18. 获奖公布|@程序员,你读过的书,藏着自己的命运
  19. 懒惰程序员的百宝箱:提升工作效率的七大神器
  20. 网易2016招聘笔试升级之路Java代码

热门文章

  1. 缺少ncurses包的解决办法
  2. 1 ELK安装部署并监控nginx
  3. ubuntu中make出错
  4. nginx启动报错 :Failed to start The nginx HTTP and reverse prox...er.
  5. 百度贴吧中的匿名回复,根本不是匿名,完全可以看到用户的全部IP。
  6. 解决文件夹无限嵌套无法删除的问题---最新办法
  7. 解决PRINT函数UTF-8问题
  8. Android中如何解决输入法键盘和activity页面遮挡的问题
  9. dubbo调用服务出现如下异常
  10. 如何重置/删除chrome的输入突出显示/焦点边框? [重复]