uni-status-bar.vue 548 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <view :style="{ height: statusBarHeight }" class="uni-status-bar">
  3. <slot />
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name: 'UniStatusBar',
  9. data() {
  10. return {
  11. // #ifdef MP-WEIXIN
  12. statusBarHeight: uni.getWindowInfo().statusBarHeight + 'px',
  13. // #endif
  14. // #ifndef MP-WEIXIN
  15. statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
  16. // #endif
  17. }
  18. }
  19. }
  20. </script>
  21. <style lang="scss" >
  22. .uni-status-bar {
  23. // width: 750rpx;
  24. height: 20px;
  25. // height: var(--status-bar-height);
  26. }
  27. </style>