let info = uni.createSelectorQuery().select(".info-box");
info.boundingClientRect(function(data) { //data - 各种参数
//readonly bottom: number;
// readonly height: number;
// readonly left: number;
// readonly right: number;
// readonly top: number;
// readonly width: number;
// readonly x: number;
// readonly y: number;
that.setWebviewHeight(parseInt(data.height))
console.log('元素高度为--->>',parseInt(data.height)) // 获取元素宽度
}).exec()
网友评论