Vue报错:Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation

Vue报错: Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation

重复点击相同路由,出现的问题

在【 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)
}

猜你喜欢

转载自blog.csdn.net/weixin_46267445/article/details/120090307
今日推荐