<template>
  <section class="app-main">
    <TrialsTab v-if="isShow" />
    <!--<TrialsTab />-->
    <transition name="fade-transform" mode="out-in">
      <keep-alive :include="cachedViews">
        <router-view :key="key" />
      </keep-alive>
    </transition>
  </section>
</template>

<script>
import TrialsTab from '@/components/TrialsTab'
export default {
  name: 'AppMain',
  components: {
    TrialsTab
  },
  computed: {
    isShow() {
      return ~this.$route.path.indexOf('/trials-panel')
    },
    cachedViews() {
      return this.$store.state.tagsView.cachedViews
    },
    key() {
      return this.$route.path
    }
  }
}
</script>

<style lang="scss" scoped>
.app-main {
  /*50 = navbar  */
  // min-height: calc(100vh - 50px);
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fixed-header + .app-main {
  // padding-top: 50px;
  padding:50px 10px 10px 10px;
}

.hasTagsView {
  .app-main {
    min-height: calc(100vh - 84px);
  }

  .fixed-header+.app-main {
    padding-top: 84px;
  }
}
</style>

<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
  .fixed-header {
    padding-right: 15px;
  }
}
</style>
