<template>
  <div class="homeWrap" v-loading="loading">
    <el-container v-if="isShowHd">
      <el-main>
        <el-header>
          <div class="headerHDBox">
            <HeaderCom class="headerRight" @setLoding="setLoding"></HeaderCom>
            <MenuHD class="menuBox"></MenuHD>
            <HeaderCom class="headerRight" @setLoding="setLoding"></HeaderCom>
          </div>
        </el-header>

        <!-- <MenuTag></MenuTag> -->
        <!-- 主体内容-->
        <transition name="slide-fade">
          <div class="main-content">
            <router-view />
          </div>
        </transition>
      </el-main>
    </el-container>
    <el-container v-else="!isShowHd">
      <Menu></Menu>
      <el-main>
        <HeaderCom class="headerBox" @setLoding="setLoding"></HeaderCom>
        <!-- <MenuTag></MenuTag> -->
        <!-- 主体内容-->
        <transition name="slide-fade">
          <div class="main-content">
            <router-view />
          </div>
        </transition>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import HeaderCom from "@/components/HeaderCom.vue";
import MenuHD from "./components/MenuHD.vue";
import Menu from "./components/Menu.vue";
import MenuTag from "@/components/MenuTag.vue";

export default {
  components: {
    Menu,
    MenuHD,
    HeaderCom,
    MenuTag,
  },
  data() {
    return {
      // history: ["11", "22", "33"],
      loading: false,
      isShowHd: true,
    };
  },
  mounted() {},
  created() {},
  methods: {
    setLoding(state) {
      this.loading = state;
    },
  },
};
</script>

<style lang="scss" scoped>
.homeWrap {
  height: 100vh;
  .el-container {
    // height: 100%;
    min-height: 88vh;
  }
  .el-main {
    min-width: 800px;
    // min-height: 88vh;
    height: 100%;
    background-color: #f7f7f8;
    padding: 0;
    .main-content {
      height: 100%;
    }
  }
}
::v-deep.el-header {
  padding: 0 !important;
  background: #1b3b7f;
  color: #fff !important;
  .headerHDBox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: url("../../assets/headerBorder.png");
    // background-size: contain;
    background-size: 6%, 100%;
    background-repeat: repeat-x; /* 水平方向重复 */
  }
  .menuBox {
    flex: 1;
    overflow-x: scroll;
    align-items: center;
    justify-content: center;
    display: flex;
    // background: url("../../assets/headerBorder.png") no-repeat center center;
    // background-size: 100% 100%; /* 强行拉伸，可能会导致图片变形 */
  }
  .headerRight {
  }
}
.headerBox {
  background: #fff;
}
.slide-fade-enter-active {
  transition: all 0.3s ease-out;
}

.slide-fade-leave-active {
  transition: all 0.5s cubic-bezier(1, 0.5, 0.6, 1);
}

.slide-fade-enter-from,
.slide-fade-leave-to {
  transform: translateX(50px);
  opacity: 0;
}
</style>
