<template>
  <section class="app-main">
    <!-- <template>
      <div v-if="$route.path !== '/dashboard'" class="breadcrumb-container">
        <div class="empty" />
        <div class="breadcrumb-box">
          <breadcrumb />
        </div>
      </div>
      <div v-if="$route.path !== '/dashboard'" class="breadcrumb-empty" />
    </template> -->

    <transition name="fade-transform" mode="out-in">
      <router-view :key="key" />
    </transition>
  </section>
</template>

<script>
export default {
  name: 'AppMain',
  computed: {
    key() {
      return this.$route.path
    }
  }
}
</script>

<style lang="scss" scoped>
.app-main {
  /*50 = navbar  */
  min-height: calc(100vh - 155px);
  /* min-height: 100vh; */
  width: calc(100% - 40px);
  position: relative;
  overflow: hidden;
  box-shadow: 0px 0px 5px #ccc;
  border-radius: 10px;
}
.fixed-header+.app-main {
  /* padding: 100px 20px 20px 20px; */
  margin: 85px 20px 70px 20px;
  background: #fff;
  padding: 20px;
}

@media screen and (max-width: 768px) {
  .app-main {
    /*50 = navbar  */
    min-height: calc(100vh - 170px);
    /* min-height: 100vh; */
    width: calc(100% - 40px);
    position: relative;
    overflow: auto;
    min-width: 1000px;
  }
  .breadcrumb-container {
    left: 74px;
    min-width: 1000px;
    overflow-x: scroll;
  }
}
</style>

<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
  .fixed-header {
    padding-right: 15px;
  }
}
// .breadcrumb-container {
//   position: fixed;
//   top: 70px;
//   left: 240px;
//   width: calc(100% - 250px);
//   background: #fff;
//   padding-left: 20px;
//   height: 65px;
//   z-index: 10;
//   .empty {
//     height: 20px;
//     width: calc(100% + 20px) ;
//     background: #F6F9FC;
//     margin-left: -20px;
//   }
//   .breadcrumb-box {
//     margin-top: 15px;
//   }
// }
.breadcrumb-empty {
  height: 15px;
  margin-top: 10px;
}
</style>
