小程序 小程序选择器获取节点信息wx.createSelectorQuery 小程序选择器获取节点信息wx.createSelectorQuery // An highlighted block var query = wx.createSelectorQuery(); //选择id query.select('#drawID').boundingClientRect() query.exec(function (res) { //res就是 该元素的信息 数组 console.log(res); //取高度 _this.setData({ Width: res[0].width, Height: res[0].height }) }) 可以得到以下信息