context.draw 的第二个参数直接传入一个 function() {} 的话,function() {} 内部的 this 的指向不一定是当前页面实例。
所以可以先把 function() {} 改为
function () {
console.log( '看看这句话执行没' )
this .setData({
canvasComplate: true ,
})
}
|
先看看这句 Log 执行没有,如果执行了,则改成
context.draw( false , () => {
this .setData({
canvasComplate: true ,
})
})
|
应该就可以了。