onReady(){
let that = this
uni.getSystemInfo({
success: function(res) { // res - 各种参数
console.log(res.windowHeight); // 屏幕的宽度
let info = uni.createSelectorQuery().select(".hander");// 获取某个元素
info.boundingClientRect(function(data) { //data - 各种参数
console.log(data.height) // 获取元素宽度
let view = res.windowHeight - data.height
that.heightHome = view
}).exec()
}
});
},原文:https://www.cnblogs.com/cl1998/p/13492138.html