获取 高度 (单位px)
let query = wx.createSelectorQuery();
query.select('.content').boundingClientRect(rect=>{
let height = rect.height;
console.log(height);
}).exec();
// .exec() 不加不执行
获取 高度 (单位rpx)
let query = wx.createSelectorQuery();
query.select('.content').boundingClientRect(rect=>{
let clientHeight = rect.height;
let clientWidth = rect.width;
let ratio = 750 / clientWidth;
let height = clientHeight * ratio;
console.log(height);
}).exec();