data: {
statusbar: 0
},
页面获取状态栏高度
onLoad: function (e) {
const res = wx.getSystemInfoSync()
var statusbarH = res.statusBarHeight
this.setData({
statusbar :statusbarH
})
},
组件获取状态栏高度
attached() {
const res = wx.getSystemInfoSync()
var statusbarH = res.statusBarHeight
this.setData({
statusbar: statusbarH
})
},