使用element-ui的子菜单项点击两下出现 NavigationDuplicated {_name: "NavigationDuplicated", 报错

NavigationDuplicated {_name: “NavigationDuplicated”, name: “NavigationDuplicated”, message: “Navigating to current location (”/home/huge") is not allowed", stack: “Error↵ at new NavigationDuplicated (webpack-int…e_modules/element-ui/lib/mixins/emitter.js:29:22)”}

输入下面代码放在,路由文件里面即可解决问题

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

你可能感兴趣的:(vue)