VueRouter路由跳转报错:vue-router.esm.js?fe87:2100 Uncaught (in promise) NavigationDuplicated
时间:2020-05-25 19:12:06
收藏:0
阅读:943
错误信息:
vue-router.esm.js?fe87:2100 Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated", message: "Navigating to current location ("/home") is not allowed", stack: "Error↵ at new NavigationDuplicated (webpack-int…node_modules/vue/dist/vue.runtime.esm.js:2178:14)"}
出现情况:
解决方案:
1、在使用 replace、push等方法时捕获异常
2、在包含这句代码 Vue.use(Router) 的文件中加入如下代码:
即可解决问题
原文:https://www.cnblogs.com/Object-L/p/12959925.html
评论(0)