uni-status-bar.vue 452 B

123456789101112131415161718192021222324252627
  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. statusBarHeight: 20
  12. }
  13. },
  14. mounted() {
  15. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
  16. }
  17. }
  18. </script>
  19. <style lang="scss" >
  20. .uni-status-bar {
  21. // width: 750rpx;
  22. height: 20px;
  23. // height: var(--status-bar-height);
  24. }
  25. </style>