this.$router.push(“路径“); 发生警告
// 重写路由的push 解决跳转当前导航的警告(router中加入)
const originPush = VueRouter.prototype.push
VueRouter.prototype.push = function (location) {
return originPush.call(this, location).catch(err => err)
}
// 重写路由的push 解决跳转当前导航的警告(router中加入)
const originPush = VueRouter.prototype.push
VueRouter.prototype.push = function (location) {
return originPush.call(this, location).catch(err => err)
}
共有 0 条评论