终止h5页面跳转返回刷新,利用路由缓存,找准缓存清除时机
//清除缓存页面路由缓存
beforeRouteLeave(to, from, next) {
if (to.path == "/myselfPlan" && this.$vnode.parent) {
this.$vnode.parent.componentInstance.cache={}
this.$vnode.parent.componentInstance.keys=[]
}
next();
},
App.vue中需要相关操作