环境:ios的app里的webview,机型iPhone 12
应该是设备信息的api有问题,用setTimeout延迟两秒就可以获取到statusBarHeight,
<template>
<view class="content">
<uni-nav-bar title="title" statusBar="true"></uni-nav-bar>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
import uniNavBar from "@/components/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue"
export default {
components:{
uniNavBar
},
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
</script>