enterprise.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div class="parent d-flex flex-column">
  3. <Headers class="headers"></Headers>
  4. <div class="content d-flex">
  5. <side class="content-sticky" v-if="whiteList.indexOf(router.currentRoute.value.path) === -1"></side>
  6. <div class="pa-3 content-box">
  7. <router-view></router-view>
  8. </div>
  9. </div>
  10. <Slider class="slider"></Slider>
  11. </div>
  12. </template>
  13. <script setup>
  14. import Headers from './company/navBar.vue'
  15. import Slider from './company/slider.vue'
  16. import side from './company/side.vue'
  17. import { useRouter } from 'vue-router'
  18. defineOptions({ name: 'enterprise-layout-index' })
  19. // 不展示侧边栏名单
  20. const whiteList = ['/enterprise/enterpriseCenter']
  21. const router = useRouter()
  22. console.log('router.currentRoute.value.path', router.currentRoute.value.path)
  23. </script>
  24. <style lang="scss" scoped>
  25. $top: 50px;
  26. .parent {
  27. background-color: var(--default-bgc);
  28. }
  29. .headers {
  30. position: sticky;
  31. top: 0;
  32. z-index: 999;
  33. }
  34. .slider {
  35. position: fixed;
  36. bottom: 50%;
  37. right: 24px;
  38. translate: 0 50%;
  39. z-index: 999;
  40. }
  41. .content {
  42. height: 0;
  43. flex: 1;
  44. &-box {
  45. width: 100%;
  46. }
  47. &-sticky {
  48. position: sticky;
  49. top: $top;
  50. height: calc(100vh - $top);
  51. }
  52. }
  53. </style>