// 计算屏幕剩余高度 填补剩余高度
let _this = this
uni.getSystemInfo({
success(res) {
_this.phoneHeight = res.windowHeight
console.log(res.windowHeight)
// 计算组件的高度
let view = uni.createSelectorQuery().select(".hd-height")
view.boundingClientRect(data => {
_this.navHeight = data.height
console.log(_this.navHeight)
_this.scrollviewHigh = _this.phoneHeight - _this.navHeight
}).exec()
}
})
最后强制绑定style
获得的高度单位是 px 不是