index.vue 282 B

1234567891011121314
  1. <template>
  2. <view :style="{ height: barHeight + 'px' }"></view>
  3. </template>
  4. <script setup>
  5. import { ref, onMounted } from 'vue'
  6. const barHeight = ref(0)
  7. onMounted(() => {
  8. const systemInfo = uni.getSystemInfoSync()
  9. barHeight.value = systemInfo.statusBarHeight || 0
  10. })
  11. </script>