提交 d9c73af6 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

refactor(element-draw): 优化 element 非空断言

上级 5588f7f1
......@@ -17,7 +17,7 @@
<!-- #endif -->
</template>
<script>
<script lang="uts">
var y = 160
export default {
data() {
......@@ -57,9 +57,9 @@
},
methods: {
drawText() {
let element = uni.getElementById('draw-text-view')
let ctx = element!.getDrawableContext()
let width = element!.getBoundingClientRect().width
let element = uni.getElementById('draw-text-view')!
let ctx = element.getDrawableContext()
let width = element.getBoundingClientRect().width
ctx!.reset()
ctx!.font = "15px"
ctx!.textAlign = "center"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册