diff --git a/pages/component/canvas/canvas.uvue b/pages/component/canvas/canvas.uvue index 4141927ffddd2dfee1157801c22c7bf1fadd0662..a58b4b15bb36c7e94dc6e31819425a40e66526b9 100644 --- a/pages/component/canvas/canvas.uvue +++ b/pages/component/canvas/canvas.uvue @@ -13,16 +13,14 @@ data() { return { title: 'Canvas', - drawing: null as any | null, - canvasElement: null as any | null, - canvasContext: null as any | null, + drawing: null as UniElement | null, + canvasElement: null as HTMLCanvasElement | null, + canvasContext: null as CanvasRenderingContext2D | null, } }, onReady() { - this.drawing = this.$refs['drawing'] as any; - // @ts-ignore - this.canvasElement = document.createElement('canvas') - // @ts-ignore + this.drawing = this.$refs['drawing'] as UniElement; + this.canvasElement = document.createElement('canvas') as HTMLCanvasElement; this.canvasElement.className = 'canvas' this.drawing!.appendChild(this.canvasElement) @@ -33,7 +31,7 @@