// 計算屏幕剩餘高度 填補剩餘高度
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()
}
})this
最後強制綁定style get
得到的高度單位是 px 不是 console