提交 34e65701 编写于 作者: shutao-dc's avatar shutao-dc

update view-draw.uvue

上级 c58f613c
......@@ -57,9 +57,9 @@
},
methods: {
drawText() {
let node = (this.$refs['draw-text-view'] as INode)
let ctx = node.getDrawableContext()
let width = node.getBoundingClientRect().width
let element = (this.$refs['draw-text-view'] as Element)
let ctx = element.getDrawableContext()
let width = element.getBoundingClientRect().width
ctx!!.reset()
ctx!!.font = "15px"
ctx!.textAlign = "center"
......@@ -74,7 +74,7 @@
ctx!!.update()
},
drawLines() {
let ctx = (this.$refs['draw-line-view'] as INode).getDrawableContext()
let ctx = (this.$refs['draw-line-view'] as Element).getDrawableContext()
ctx!!.reset()
ctx!!.lineWidth = 10;
......@@ -129,7 +129,7 @@
y += 15;
},
drawCircles() {
let ctx = (this.$refs['draw-circle-view'] as INode).getDrawableContext()
let ctx = (this.$refs['draw-circle-view'] as Element).getDrawableContext()
ctx!!.reset()
// Draw shapes
for (var i = 0; i < 4; i++) {
......@@ -155,7 +155,7 @@
},
drawStar() {
let ctx = (this.$refs['draw-dash-line'] as INode).getDrawableContext()
let ctx = (this.$refs['draw-dash-line'] as Element).getDrawableContext()
ctx!!.reset()
ctx!!.beginPath();
var horn = 5; // 画5个角
......@@ -226,7 +226,7 @@
return result
},
drawhouse() {
let ctx = (this.$refs['draw-house'] as INode).getDrawableContext()
let ctx = (this.$refs['draw-house'] as Element).getDrawableContext()
ctx!!.reset()
ctx!!.lineWidth = 10;
......@@ -246,7 +246,7 @@
ctx!!.update()
},
drawPoint() {
let ctx = (this.$refs['draw-style'] as INode).getDrawableContext()
let ctx = (this.$refs['draw-style'] as Element).getDrawableContext()
ctx!!.reset()
for (let i = 0; i < 6; i++) {
for (let j = 0; j < 6; j++) {
......@@ -265,7 +265,7 @@
ctx!!.update()
},
drawRect() {
let ctx = (this.$refs['draw-odd'] as INode).getDrawableContext()
let ctx = (this.$refs['draw-odd'] as Element).getDrawableContext()
ctx!!.reset()
// Create path
ctx!!.moveTo(30, 90);
......@@ -283,7 +283,7 @@
},
drawArcTo() {
let ctx = (this.$refs['draw-arcto'] as INode).getDrawableContext()
let ctx = (this.$refs['draw-arcto'] as Element).getDrawableContext()
ctx!.reset()
ctx!.beginPath();
ctx!.moveTo(50, 20);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册