element-uiのサブメニュー項目を使用して2回クリックするとNavigationDuplicated{_name:「NavigationDuplicated」が表示され、エラーが表示されます.

496 ワード

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