天天看點

解決點選目前相同路由的時候控制台報錯

防止點選目前相同路由的時候控制台報錯

解決vue項目輕按兩下路由導航報錯 "Navigating to current location (XXX) is not allowed"

const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error=> error)
}