不清楚你出于何种需求要这么搞。只打印一次的猜测:同一个canvas, draw后只回调一次。解决方案:
wxml: 动态创建canvas
<block wx: for = "{{tempfileLen}}" >
<canvas canvas-id= "canvas_{{index}}" />
</block>
js:
this .setData({
tempfileLen: tempFilePaths.length
})
for (let i in tempFilePaths) {
let ctx = wx.createCanvasConetext(`canvas_${i}`)
....
....
}
|