Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
报错:Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location解决办法:在路由文件中加入如下代码,即可解决import VueRouter from "vue-router";//pushconst VueRouterPush = VueRouter.prototype.
·
报错:
Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
解决办法:
在路由文件中加入如下代码,即可解决
import VueRouter from "vue-router";
//push
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
return VueRouterPush.call(this, to).catch(err => err)
}
//replace
const VueRouterReplace = VueRouter.prototype.replace
VueRouter.prototype.replace = function replace (to) {
return VueRouterReplace.call(this, to).catch(err => err)
}
更多推荐
已为社区贡献11条内容
所有评论(0)