1:ライフサイクルの準備完了フェーズで取得する必要がある
。 2: wx.createSelectorQuery() の後に in() を使用して範囲を指定する必要がある。
Component({
properties(){
},
data(){
},
methods(){
},
lifetimes: {
ready: function (){
wx.createSelectorQuery().in(this).select('.canvas').boundingClientRect(function (rect) {
console.log(rect)
}).exec()
}
})