1、js获取页面节点位置信息
wx.createSelectorQuery().selectAll(`.${this.data.selector} >>> .${this.data.selector}-rect`).boundingClientRect().exec(function(res){
that.setData({
skeletonRectLists: res[0]
})
console.log(that.data);
});
2、boundingClientRect()
boundingClientRect() 该方法获取每个节点 宽、高、距离屏幕 Top 、left
3、exec()
回调每个节点的信息
4、wxml 中对各个节点进行css样式绑定。