AppMain.vue 670 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% - 48px);
    overflow-x: auto;
    padding: 15px;
    box-sizing: border-box;
    background-color: #EDF1F7;
    box-sizing: border-box;

  }
}
</style>