<view class="nav-bar"
:style="{
'height': navHeight + 'px'
}">
</view>
data() {
return {
// 头部总高度,iPhone5/6/7/8默认64px
navHeight:64,
}
}
onLoad(params) {
this.attached()
},
methods: {
attached() {
var that = this;
wx.getSystemInfo({
success: (result) => {
if(result.statusBarHeight == 20) {
this.navHeight = 64
}else {
this.navHeight = 88
}
},
})
},
}
微信小程序 - 自定义标题机型适配
最新推荐文章于 2023-03-01 20:24:13 发布