home.vue 1.55 KB
<!-- home -->
<template>
  <div class="container">
    <template v-if="showWindow || $route.meta.noAuth">
      <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>
      <template v-if="$route.meta.isTab">
        <tab-bar :data="tabList"></tab-bar>
      </template>
    </template>
  </div>
</template>
<script>
export default {
  data () {
    return {
      tabList: [
        {
          title: '我的待办',
          name: 'home',
          inactive: require('@/assets/images/icon/home.png'),
          active: require('@/assets/images/icon/home-active.png')
        },
        {
          title: '工作台',
          name: 'workbench',
          inactive: require('@/assets/images/icon/workbench.png'),
          active: require('@/assets/images/icon/workbench-active.png')
        },
        {
          title: '营销素材',
          name: 'psd',
          inactive: require('@/assets/images/icon/psd.png'),
          active: require('@/assets/images/icon/psd-active.png')
        }
      ],
      showWindow: false
    }
  },
  watch: {
    watchFlag: {
      immediate: true,
      handler (newval) {
        this.showWindow = newval
        this.hideLoading()
      }
    }
  },
  computed: {
    watchFlag () {
      return this.$store.state.app.showWindow
    }
  },

  mounted () { },

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