含义
不要重复导航到当前位置。
解决办法
在 router.js 或者 /router/index.js 路由文件中,添加如下代码:
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
如下图:
每天学习一点点,每天进步。