技术就餐

导航

终止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中需要相关操作

 


 

posted on 2021-11-11 11:41  技术就餐  阅读(306)  评论(0编辑  收藏  举报