Newer
Older
smartKitchenFront / src / layout / components / AppMain.vue
Stephanie on 11 Nov 2022 969 bytes feat<*>: 修改品牌列表, 品类列表
<template>
  <section class="app-main">
    <transition name="fade-transform" mode="out-in">
      <!-- or name="fade" -->
      <!-- <router-view :key="key"></router-view> -->
      <div>
        <keep-alive>
          <router-view v-if="$route.meta.keepAlive" :key="key" />
        </keep-alive>
        <router-view v-if="!$route.meta.keepAlive" :key="key" />
      </div>
    </transition>
  </section>
</template>

<script>
export default {
  name: 'AppMain',
  computed: {
    key() {
      if (this.$route.meta.keepAlive) {
        return this.$route.name !== undefined ? this.$route.name : this.$route
      } else {
        return this.$route.name !== undefined ? this.$route.name + new Date() : this.$route + new Date()
      }
    }
  }
}
</script>

<style scoped>
.app-main {
  /*50 = navbar  */
  /*min-height: calc(100vh - 50px);*/
  position: relative;
  padding-top: 10px;
  /*height: 100%;*/
  /*min-width:1525px;*/
  /*min-width: 1625px;*/
}
</style>