TopMode.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <script lang="ts" setup>
  2. import { storeToRefs } from "pinia"
  3. import { useSettingsStore } from "@/store/modules/settings"
  4. import { AppMain, NavigationBar, TagsView, Logo } from "./components"
  5. const settingsStore = useSettingsStore()
  6. const { showTagsView, showLogo } = storeToRefs(settingsStore)
  7. </script>
  8. <template>
  9. <div class="app-wrapper">
  10. <!-- 头部导航栏和标签栏 -->
  11. <div class="fixed-header layout-header">
  12. <div class="content">
  13. <Logo v-if="showLogo" :collapse="false" class="logo" />
  14. <NavigationBar class="navigation-bar" />
  15. </div>
  16. <TagsView v-show="showTagsView" />
  17. </div>
  18. <!-- 主容器 -->
  19. <div :class="{ hasTagsView: showTagsView }" class="main-container">
  20. <!-- 页面主体内容 -->
  21. <AppMain class="app-main" />
  22. </div>
  23. </div>
  24. </template>
  25. <style lang="scss" scoped>
  26. @import "@/styles/mixins.scss";
  27. $transition-time: 0.35s;
  28. .app-wrapper {
  29. @extend %clearfix;
  30. width: 100%;
  31. }
  32. .fixed-header {
  33. position: fixed;
  34. top: 0;
  35. z-index: 1002;
  36. width: 100%;
  37. .logo {
  38. width: var(--v3-sidebar-width);
  39. }
  40. .content {
  41. display: flex;
  42. .navigation-bar {
  43. flex: 1;
  44. }
  45. }
  46. }
  47. .layout-header {
  48. background-color: var(--v3-header-bg-color);
  49. box-shadow: var(--v3-header-box-shadow);
  50. border-bottom: var(--v3-header-border-bottom);
  51. }
  52. .main-container {
  53. min-height: 100%;
  54. }
  55. .app-main {
  56. transition: padding-left $transition-time;
  57. padding-top: var(--v3-navigationbar-height);
  58. height: 100vh;
  59. overflow: auto;
  60. }
  61. .hasTagsView {
  62. .app-main {
  63. padding-top: var(--v3-header-height);
  64. }
  65. }
  66. </style>