jiuyiUniapp/jiuyi2/components/header/statusBar.vue

30 lines
422 B
Vue

<script setup>
/**
* 状态栏 用于手机顶部占位
*/
import {
onLoad
} from '@dcloudio/uni-app'
import {
ref
} from 'vue'
// 盒子高度
const height = ref(0)
onLoad(() => {
// 系统信息
uni.getSystemInfo().then(rs => {
height.value = rs.statusBarHeight + 'px'
})
})
</script>
<template>
<view :style="{height: height}"></view>
</template>
<style lang="scss" scoped>
//
</style>