uniapp获取元素距离顶部的距离

var that=this;

const query = uni.createSelectorQuery().in(that);
query.select('元素').boundingClientRect(data => {
console.log(data)
}).exec();

posted on 2020-11-03 11:36  uniapp  阅读(5388)  评论(0编辑  收藏  举报