<view class="header" :style="'height:'+height+'px'">
<icon class="iconfont icon-xiangyou"></icon>
<text>返回</text>
</view>```
<script>
export default {
data() {
return {
height: 30
}
},
onLoad() {
},
created() {
var _this = this;
uni.getSystemInfo({
success:function(e){
// #ifdef MP-WEIXIN
let custom = wx.getMenuButtonBoundingClientRect()
_this.height = custom.bottom + custom.top - e.statusBarHeight
// #endif
}
})
},
}
</script>
uniapp实现自定义导航时动态获取导航栏的高度
最新推荐文章于 2024-08-06 10:10:57 发布