uni-status-bar.vue 439 B

1234567891011121314151617181920212223242526
  1. <template>
  2. <view :style="{ height: statusBarHeight }" class="uni-status-bar">
  3. <slot />
  4. </view>
  5. </template>
  6. <script>
  7. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
  8. export default {
  9. name: 'UniStatusBar',
  10. data() {
  11. return {
  12. statusBarHeight: statusBarHeight
  13. }
  14. }
  15. }
  16. </script>
  17. <style>
  18. .uni-status-bar {
  19. display: block;
  20. width: 100%;
  21. height: 20px;
  22. height: var(--status-bar-height);
  23. }
  24. </style>