NavigationDuplicated: Navigating to current location ("/admin/dataAdmin") is not allowe

NavigationDuplicated: Navigating to current location ("/admin/dataAdmin") is not allowed

报错信息图
这种情况改写一下路由的push方法就可以了,将要跳转的 location的路由放进去。
原文参考地址:https://blog.csdn.net/txl910514/article/details/102746160

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

NavigationDuplicated: Navigating to current location (

你可能感兴趣的:(学习例子)