错题本

vue-router.esm.js?8c4f:2051 Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated", message: "Navigating to current location ("/login") is not allowed", stack: "Error↵ at new NavigationDuplicated (webpack-int…l (webpack-internal:///./src/http/axios.js:29:57)"}

// 在使用Element UI 时点击同一个路由,控制台报错,但不影响使用,下面是自己网上搜的解决方法:
import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

你可能感兴趣的:(错题本)