我是做了一个组件创建Canvas 这一直获取不到Canvas 咋回事?
wx.createSelectorQuery()
.in(this)
.select('#image-cropper')// 在 WXML 中填入的 id
.fields({ node: true, size: true })
.exec((res) => {
console.log(res,33333)
// Canvas 对象
this.canvas= res[0].node
// 渲染上下文
this.ctx = this.canvas.getContext('2d')
this.canvas.width=this.data._canvas_width * this.data.export_scale
this.canvas.height=this.data._canvas_height * this.data.export_scale
this.data.PushImg=this.canvas.createImage()
})