提交 964d8f3a 编写于 作者: H hdx

canvas: 增加变量类型

上级 85b3387d
......@@ -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 @@
</script>
<style>
.drawing >>> .canvas {
.drawing>>>.canvas {
width: 300px;
height: 150px;
margin-left: auto;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册