App.vue 921 Bytes
<template>
  <div id="app">
    <div v-show="isShowWindow">
      <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>
    </div>
    <div v-show="!isShowWindow">
      <div style="text-align: center;font-size: 14px;height: 48px;line-height: 48px;">无权限访问</div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'App',
  data() {
    return {
      isShowWindow: false,
    }
  },
  watch: {
    watchFlag: {
      immediate: true,
      handler(newval) {
        this.isShowWindow = newval
      }
    }
  },
  computed: {
    watchFlag() {
      return this.$store.state.app.showWindow
    }
  },

  mounted() {},

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