uniapp获取元素距离顶部的距离
var that=this;
const query = uni.createSelectorQuery().in(that);
query.select('元素').boundingClientRect(data => {
console.log(data)
}).exec();
var that=this;
const query = uni.createSelectorQuery().in(that);
query.select('元素').boundingClientRect(data => {
console.log(data)
}).exec();