代码语言:javascript复制
watchHeight() {
var query = wx.createSelectorQuery()
//.box为指定类名高度
query.select('.box').boundingClientRect((res) => {
this.setData({
height: parseInt(res.height)
})
}).exec()
}