小程序 原生获取元素样式

const elequery = wx.createSelectorQuery().in(this);
elequery.selectAll('.goods-info').boundingClientRect((res)=>{
  console.log(res)
}).exec();

 

 

goods-info --> 表示类名

res --> 返回数组 数组的长度就是 goods-item 类的个数

posted @ 2020-07-30 15:27  一只螺  阅读(728)  评论(0编辑  收藏  举报