<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;
  .routerView {
    max-height: calc(100vh - 120px);
    // background-color: #fff;
    padding: 16px;
    overflow-x: auto;
  }
  .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>