例子:当前路由是/A,点击某个按钮 push--- /A
/A不是页面跳转,只是在当前页面增加一个routerView(/A)
此时,errpr提示:Error: Avoided redundant navigation to current location: "/A".
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
Good Lucky! 😊