main-layout.vue 976 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <view class="layout-container">
  3. <!-- 顶部填充区 -->
  4. <view class="top-fill" :style="{height: safeAreaStore.statusBarHeight+'px'}"></view>
  5. <!-- 顶部胶囊区 -->
  6. <view class="capsule-container"
  7. :style="{
  8. height: safeAreaStore.capsuleBarHeight+'px',
  9. width: safeAreaStore.capsuleBarLeft+'px',
  10. 'padding-top': safeAreaStore.capsuleBarMarginTop+'px',
  11. 'padding-bottom': safeAreaStore.capsuleBarMarginBottom+'px'}">
  12. <slot name="capsule"></slot>
  13. </view>
  14. <!-- 内容区 -->
  15. <view class="content-container">
  16. <slot></slot>
  17. </view>
  18. <!-- 底部填充区 -->
  19. <view class="bottom-fill" :style="{height: safeAreaStore.bottomHeight+'px'}"></view>
  20. </view>
  21. </template>
  22. <script setup>
  23. import { useSafeAreaStore } from '@/stores/safeArea.js';
  24. const safeAreaStore = useSafeAreaStore();
  25. </script>
  26. <style lang="scss" scoped>
  27. // 不知道到为啥这里不写点东西全局就会失效,所以随便写点
  28. .tmp {}
  29. </style>