<template>
  <section class="app-main">
    <template>
      <div class="breadcrumb-container">
        <div class="empty" />
        <div class="breadcrumb-box">
          <breadcrumb />
        </div>
      </div>
      <div 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 - 170px);
  /* min-height: 100vh; */
  width: calc(100% - 40px);
  position: relative;
  overflow: hidden;
}
.fixed-header+.app-main {
  /* padding: 100px 20px 20px 20px; */
  margin: 100px 20px 70px 20px;
  background: #fff;
  padding: 20px;
}
</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: 80px;
  left: 230px;
  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>
