wx.createSelectorQuery()
.select('#myCanvas')
.fields({
node: true,
})
.node()
.exec(res=> {
const canvas = res_sl[0].node
const ctx = canvas.getContext('2d')
console.log(canvas)
})
当canvas是在component内获取不到
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),并详细描述下复现的流程。
https://developers.weixin.qq.com/s/rPYjrNmv7Hq9
https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.getContext.html