onReady(){
const data = new Uint8ClampedArray([255, 0, 0, 1])
uni.canvasPutImageData({
canvasId: 'firstCanvas',
x: 0,
y: 0,
width: 1,
data: data,
success(res) {}
})
}
就这样简单的官方例子跑不起来,直接报错了
13:44:02.071 appServiceSDKScriptError
13:44:02.102 43:57.874 4773 4773 I console : Cannot read property 'btoa' of undefined; at wx.canvasPutImageData
13:44:02.134 43:57.874 4773 4773 I console : TypeError: Cannot read property 'btoa' of undefined