App.vue 1.01 KB
<template>
  <div id="app">
    <template v-if="showWindow">
      <transition name="fade">
        <keep-alive v-if="$route.meta.keepAlive">
          <router-view></router-view>
        </keep-alive>
      </transition>
      <transition name="fade">
        <router-view v-if="!$route.meta.keepAlive"></router-view>
      </transition>

      <!-- 底部全局 TabBar -->
      <!-- <tab-bar v-if="$route.meta.showTabBar"></tab-bar> -->
    </template>
  </div>
</template>
<script>
// import TabBar from '@/components/tabBar/index.vue'

export default {
  name: 'App',
  // components: {
  //   TabBar
  // },
  data() {
    return {
      showWindow: false
    }
  },
  watch: {
    watchFlag: {
      immediate: true,
      handler(newval) {
        console.log(newval, '===')
        this.showWindow = newval
        this.hideLoading()
      }
    }
  },
  computed: {
    watchFlag() {
      return this.$store.state.app.showWindow
    }
  },
  mounted() {},

  methods: {}
}
</script>
<style lang="scss" scoped>
</style>