uni-status-bar.vue 446 B

12345678910111213141516171819202122232425
  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 lang="scss" scoped>
  18. .uni-status-bar {
  19. width: 750rpx;
  20. height: 20px;
  21. // height: var(--status-bar-height);
  22. }
  23. </style>