出现 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation 问题
时间:2020-12-03 18:02:21
收藏:0
阅读:562
主要原因是Vue 重复点击相同路由造成的:
解决方案:
第一种:在 router 文件夹下里面的文件index.js里面找到如下位置:
// src/router/index.js
Vue.use(Router)
const router = new Router({
routes
})
找到上面位置,在下面增加这段代码即可。
const VueRouterPush = Router.prototype.push
Router.prototype.push = function push (to) {
return VueRouterPush.call(this, to).catch(err => err)
}
参考链接:https://blog.csdn.net/qq_36437172/article/details/108269846
原文:https://www.cnblogs.com/wlming/p/14081247.html
评论(0)