AppMain.vue 641 Bytes
<template>
  <section class="app-main">
    <transition name="fade-transform" mode="out-in">
      <keep-alive :include="cachedViews">
        <router-view :key="key" />
      </keep-alive>
    </transition>
  </section>
</template>
<script>
export default {
  name: 'AppMain',
  computed: {
    cachedViews () {
      return this.$store.state.tagsView.cachedViews
    },
    key () {
      return this.$route.path
    },
  },
}
</script>

<style lang="scss" scoped>
.hasTagsView {
  .app-main {
    height: calc(100% - 88px);
    overflow-x: auto;
    padding: 15px;
    box-sizing: border-box;
    background-color: #fefefe;
  }
}
</style>