解決點擊當前相同路由的時候控制檯報錯

防止點擊當前相同路由的時候控制檯報錯

解決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)
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章