<template>
  <section class="app-main">
    <transition name="fade" 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() {
      // 加上 key 解决点击左侧和tags切换 时不刷新问题；公用一个组件的不同页面 created 不执行的问题；
      return this.$route.fullPath
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss">
	.app-main{
		margin-top: 84px;
	}
</style>
