app.vue

<template>
  <div >
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>
<script>
export default {
  name: 'App',
  provide() {
    return {
      reload: this.reload
    }
  },
  data () {
    return {
      isRouterAlive: true
    }
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      })
    }
  }
  
}
</script>

需要刷新的页面(lscz.vue)中注册 reload ,调用reload() 方法,

export default {
  components: {
    "v-lsczLeft": lsczLeft
  },
  inject: ['reload'],  //注入reload方法
  data() {
    return {
    };
  },
  methods: {
    gdSubmit() {
       this.teload();  //刷新
    }
  }
}

 

相关文章:

  • 2021-07-10
  • 2021-12-19
  • 2021-05-23
  • 2021-12-13
  • 2021-12-22
  • 2022-01-13
  • 2021-05-27
猜你喜欢
  • 2021-04-02
  • 2021-12-19
  • 2021-12-05
  • 2021-12-20
  • 2021-08-15
  • 2021-12-19
  • 2021-11-30
相关资源
相似解决方案