ElementUI/vue router连续点击多次路由报错解决方法

 

NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated", message: "Navigating to current location ("/produce/delivery-order") is not allowed", stack: "Error↵

at new NavigationDuplicated (webpack-int…_modules/[email protected]@vue/dist/vue.esm.js:1862:26)"

 

在main.js下添加一下代码:

import Router from 'vue-router'

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

 

发布了26 篇原创文章 · 获赞 16 · 访问量 7万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章