<template>
  <div id="renderPage" :style="navStatusCss ? 'margin-left:64px;' : ''">
    <nav-bar />
    <tabber-list />
    <transition :name="transitionName" mode="out-in">
      <router-view class="routerView"></router-view>
    </transition>
  </div>
</template>

<script>
import navBar from "./navBar";
import tabberList from "@/components/tabberList";
export default {
  components: { tabberList, navBar },
  data() {
    return {
      transitionName: "slide-right",
    };
  },
  computed: {
    //获取是否收起导航菜单
    navStatusCss() {
      return this.$store.state.navStatus;
    },
  },
};
</script>

<style lang="less" scoped>
#renderPage {
  margin-left: 226px;
  transition: all 0.3s;
  min-width: 786px;
  .routerView {
    max-height: calc(100vh - 120px);
    padding: 16px;
    overflow-x: auto;
    &::-webkit-scrollbar {
      width: 12px;
    }

    /* 滚动槽 */
    &::-webkit-scrollbar-track {
      border-radius: 10px;
    }

    /* 滚动条滑块 */
    &::-webkit-scrollbar-thumb {
      border-radius: 10px;
      background: #eee;
    }
  }
  .routerLoading {
    background: red;
  }
}
.slide-right-enter-active,
.slide-right-leave-active,
.slide-left-enter-active,
.slide-left-leave-active {
  will-change: transform;
  transition: all 0.3s;
  // position: absolute;
}
.slide-right-enter {
  opacity: 0;
  transform: translate3d(-35%, 0, 0);
}
.slide-right-leave-active {
  opacity: 0;
  transform: translate3d(35%, 0, 0);
}
.slide-left-enter {
  opacity: 0;
  transform: translate3d(35%, 0, 0);
}
.slide-left-leave-active {
  opacity: 0;
  transform: translate3d(-35%, 0, 0);
}
</style>