<!--
  @description: 模板页面
  @author: Adrian
-->
<template>
  <section class="appMain">
    <transition name="fade-transform" mode="out-in">
      <router-view v-if="isRouterAlive" />
    </transition>
  </section>
</template>
<script>
export default {
  name: 'AppMain',
  provide() {
    return {
      reload: this.reload // 刷新
    }
  },
  data() {
    return {
      isRouterAlive: true// 刷新状态值
    }
  },
  watch: {
    '$store.getters.info': {
      handler() {
        this.reload()
      }
    }
  },
  methods: {
    // 刷新
    reload() {
      this.isRouterAlive = false
      this.$nextTick(function() {
        this.isRouterAlive = true
      })
    }
  }
}
</script>
<style lang='less'>
.appMain{
  height: 100%;
}
</style>

