<template>
  <div class="app-main">
    <tags-view/>
    <div class="content">
      <transition name="el-fade-in-linear" mode="out-in">
        <keep-alive :include="cachedViews">
          <router-view :key="key"/>
        </keep-alive>
      </transition>
    </div>
  </div>
</template>

<script>
import { TagsView } from './index'

export default {
  name: 'AppMain',
  components: {
    TagsView
  },
  computed: {
    cachedViews() {
      return this.$store.state.tagsView.cachedViews
    },
    key() {
      return this.$route.fullPath
    }
  }
}
</script>

<style scoped lang="scss">
.app-main {
  /*84 = navbar + tags-view = 50 +34 */
  flex: 1;
  width: 80%;
  .content{
    margin: 10px 10px 0 10px;
    height: calc(100% - 47px);
    padding: 5px;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    &:hover{
      overflow-y: auto;
    }
  }
}
</style>

