You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
548 B

3 weeks ago
  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>