提交 747daddc 编写于 作者: H hdx

browser-canvas: 调整 UniElement 为 HTMLElement

上级 3fe63153
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
data() { data() {
return { return {
title: '浏览器 canvas', title: '浏览器 canvas',
drawing: null as UniElement | null, drawing: null as HTMLElement | null,
canvasElement: null as HTMLCanvasElement | null, canvasElement: null as HTMLCanvasElement | null,
canvasContext: null as CanvasRenderingContext2D | null, canvasContext: null as CanvasRenderingContext2D | null,
} }
}, },
onReady() { onReady() {
this.drawing = this.$refs['drawing'] as UniElement; this.drawing = this.$refs['drawing'] as HTMLElement;
this.canvasElement = document.createElement('canvas') as HTMLCanvasElement; this.canvasElement = document.createElement('canvas') as HTMLCanvasElement;
this.canvasElement.className = 'canvas' this.canvasElement.className = 'canvas'
this.drawing!.appendChild(this.canvasElement) this.drawing!.appendChild(this.canvasElement)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册