diff --git a/pages/component/canvas/canvas.uvue b/pages/component/canvas/canvas.uvue index 19dd3d0643db89c6a5ef255f5faa9e8ff2b7afc6..71d8abe38db896a0f9f0992f23fba8e6d3d70b1d 100644 --- a/pages/component/canvas/canvas.uvue +++ b/pages/component/canvas/canvas.uvue @@ -76,7 +76,7 @@ testFrameCount: 0 } }, - onReady() { + onLoad() { // HBuilderX 4.25+ // 异步调用方式, 跨平台写法 uni.createCanvasContextAsync({ @@ -100,14 +100,15 @@ this.testCanvasContext = true } }) - - // 同步调用方式,仅支持 app/web - // let canvas = uni.getElementById("canvas") as UniCanvasElement - // this.renderingContext = canvas.getContext("2d") - // hidpi(canvas); - // this.canvas = canvas; - // this.canvasWidth = canvas.width; - // this.canvasHeight = canvas.height; + }, + onReady() { + // 同步调用方式,仅支持 app/web + // let canvas = uni.getElementById("canvas") as UniCanvasElement + // this.renderingContext = canvas.getContext("2d") + // hidpi(canvas); + // this.canvas = canvas; + // this.canvasWidth = canvas.width; + // this.canvasHeight = canvas.height; }, onUnload() { if (this.taskId > 0) {