如上图所示,左侧为微信小程序,右侧为支付宝小程序,因为要计算元素的高度,跟对应的id,所以必须要知道当前元素对应的绑定的id为多少,希望有遇到这个问题或者知道如何解决的小伙伴帮我一下。感激不尽。
const query = Taro.createSelectorQuery().in(this.$scope)
query.selectAll('.section').boundingClientRect().exec(rect => {
if (rect && rect.length > 0) {
rect[0].forEach(item => {
console.log(item)
});
}
})