<template>
  <div class="parent d-flex flex-column">
    <Headers class="headers"></Headers>
    <div class="content d-flex">
      <side class="content-sticky" v-if="whiteList.indexOf(router.currentRoute.value.path) === -1"></side>
      <div class="pa-3 content-box">
        <router-view></router-view>
      </div>
    </div>
    <Slider class="slider"></Slider>
  </div>
</template>

<script setup>
import Headers from './company/navBar.vue'
import Slider from './company/slider.vue'
import side from './company/side.vue'
import { useRouter } from 'vue-router'
defineOptions({ name: 'enterprise-layout-index' })
// 不展示侧边栏名单
const whiteList = ['/enterprise/enterpriseCenter']
const router = useRouter()
console.log('router.currentRoute.value.path', router.currentRoute.value.path)
</script>

<style lang="scss" scoped>
$top: 50px;
.parent {
  background-color: var(--default-bgc);
}
.headers {
  position: sticky;
  top: 0;
  z-index: 999;
}
.slider {
  position: fixed;
  bottom: 50%;
  right: 24px;
  translate: 0 50%;
  z-index: 999;
}
.content {
  height: 0;
  flex: 1;
  &-box {
    width: 100%;
  }

  &-sticky {
    position: sticky;
    top: $top;
    height: calc(100vh - $top);
  }
}

</style>