cwg-page-wrapper.vue 912 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <view class="page-wrapper">
  3. <cwg-header />
  4. <view :style="{ height: `calc(${statusBarHeight}px + 60px)` }" />
  5. <slot></slot>
  6. <view :style="{ height: isTabBarPage ? '60px' : '0px' }" />
  7. <cwg-tab-bar v-model:isTabBarPage="isTabBarPage" />
  8. </view>
  9. </template>
  10. <script setup>
  11. import { ref, onMounted,computed } from "vue";
  12. import { onLoad, onShow } from '@dcloudio/uni-app'
  13. import { updateRoute } from '@/hooks/useRoute'
  14. import useGlobalStore from '@/stores/use-global-store'
  15. const globalStore = useGlobalStore()
  16. const statusBarHeight = computed(() => globalStore.statusBarHeight);
  17. const isTabBarPage = ref(false)
  18. onLoad(() => {
  19. updateRoute()
  20. })
  21. onShow(() => {
  22. updateRoute()
  23. })
  24. </script>
  25. <style lang="scss" scoped>
  26. @import "@/uni.scss";
  27. .page-wrapper {
  28. padding: 0 px2rpx(24) px2rpx(0) px2rpx(24);
  29. box-sizing: border-box;
  30. border: 1px solid rgba(0, 0, 0, 0);
  31. }
  32. </style>