diff --git a/pages/component/canvas/canvas.uvue b/pages/component/canvas/canvas.uvue index 71d8abe38db896a0f9f0992f23fba8e6d3d70b1d..f56e71be9a3a811778e4f7bf0290b5af02b57a1d 100644 --- a/pages/component/canvas/canvas.uvue +++ b/pages/component/canvas/canvas.uvue @@ -96,12 +96,15 @@ this.testToBlobResult = (blob.size > 0 && blob.type == 'image/jpeg') }, 'image/jpeg', 0.95) // #endif - this.testToDataURLResult = context.toDataURL().startsWith('data:image/png;base64') + this.testCanvasContext = true } }) }, onReady() { + // TODO app-android 需要延迟调用 + this.testToDataURLResult = this.canvasContext!.toDataURL().startsWith('data:image/png;base64') + // 同步调用方式,仅支持 app/web // let canvas = uni.getElementById("canvas") as UniCanvasElement // this.renderingContext = canvas.getContext("2d")