vue刷新页面

复制代码
<template>
  <div id="app">
    <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
      })
    }
  }
}
复制代码
  inject: ['reload'],

 

 

 

 

posted @   青竹玉简  阅读(143)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示