小程式獲取元素的一些屬性
阿新 • • 發佈:2018-12-20
let query = wx.createSelectorQuery()
query.select('#canvas').boundingClientRect(res => {
this.canvasWidth = Math.round(res.width)
this.canvasHeight = Math.round(res.height)
}).exec()
boundingClientRect 方法的返回值