uni-app中vue3环境下uni.getSystemInfoSync().windowTop计算值不正确,有导航栏时仍为0,vue2中正常
uni-app中vue3环境下uni.getSystemInfoSync().windowTop计算值不正确,有导航栏时仍为0,vue2中正常
| 属性 | 值 |
|---|---|
| 产品分类 | uniapp/H5 |
| PC开发环境操作系统 | Mac |
| PC开发环境操作系统版本号 | 11.6 |
| HBuilderX类型 | 正式 |
| HBuilderX版本号 | 3.3.10 |
| 浏览器平台 | Chrome |
| 浏览器版本 | 97.0.4692.71(正式版本)(x86_64) |
| 项目创建方式 | HBuilderX |
示例代码:
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: ''
}
},
onLoad() {
const config = uni.getSystemInfoSync();
this.title = `windowTop:${config.windowTop}`
console.log(config);
},
methods: {
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
更多关于uni-app中vue3环境下uni.getSystemInfoSync().windowTop计算值不正确,有导航栏时仍为0,vue2中正常的实战教程也可以访问 https://www.itying.com/category-93-b0.html
7 回复
问题确认已记录,后续优化,已加分,感谢您的反馈!
更多关于uni-app中vue3环境下uni.getSystemInfoSync().windowTop计算值不正确,有导航栏时仍为0,vue2中正常的实战教程也可以访问 https://www.itying.com/category-93-b0.html
在onReady里面调用呢?
出现同样问题。。。
vue2下app端与h5端通过代码获取tabbar高度值为0,为啥不是默认50?uni.getSystemInfoSync().windowBottom = 0
bug已确认,会于近期修复,感谢反馈
4.71.2025061206-alpha 已修复,可升级到此版本


