<block wx:if="{{item.blank}}">
<canvas id="canvas{{index}}" type="2d">
<cover-view class="canvas"
mark:id="drawboard{{index}}"
mark:cid="canvas{{index}}"
style="width: 350rpx; height: 350rpx;"
bindtouchstart="drawstart"
bindtouchmove="drawing"
bindtouchend="drawend"
bindtouchcancel="drawend"
binderror="drawend"
bind:longpress="clearWord"/>
</canvas>
</block>
let item = this.createSelectorQuery().select(`#canvas${this.blank_index[i]}`).fields({ node: true, size: true, rect: true })
console.log('错误发生前?',item)
item.exec(res => {
console.log(res, '??????')
const { width, height, left, top } = res[0]
const { dpr } = this.data
this[`canvas${this.blank_index[i]}`] = res[0].node
this[`drawboard${this.blank_index[i]}`] = this[`canvas${this.blank_index[i]}`].getContext('2d')
this[`canvas${this.blank_index[i]}`].width = width * dpr
this[`canvas${this.blank_index[i]}`].height = height * dpr
this[`canvas${this.blank_index[i]}`].left = left
this[`canvas${this.blank_index[i]}`].top = top
this[`drawboard${this.blank_index[i]}`].scale(dpr, dpr)
this[`drawboard${this.blank_index[i]}`].lineJoin = "round"
this[`drawboard${this.blank_index[i]}`].lineCap = "round"
this.clearDrawboard(this[`drawboard${this.blank_index[i]}`], this[`canvas${this.blank_index[i]}`])
})
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
麻烦你先去文档看看再来发帖子吧