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

 

你可能感兴趣的:(vue前端)