<template>
  <section class="app-main">
    <transition :name="name">
      <keep-alive>
        <router-view v-if="$route.meta.keepAlive" class="router-view"/>
      </keep-alive>
    </transition>
    <transition :name="name">
      <router-view v-if="!$route.meta.keepAlive" class="router-view"/>
    </transition>
  </section>
</template>
<script>
export default {
  name: 'AppMain',
  computed: {
    key() {
      return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
    },
    name() {
      return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
    }
  },
  created() {
    console.log(this.$route)
  }
}
</script>

<style scoped>
.app-main {
  /*50 = navbar  */
  /*min-height: calc(100vh - 50px);*/
  min-height: calc(100% - 30px);
  position: relative;
  overflow: hidden;
}
</style>
