From bae67119b64898319c0fb31b780c6a224f36aa42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Thu, 11 Sep 2025 16:38:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9A=9C=E7=A2=8D=E7=89=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ruler.vue | 8 ++++++-- src/views/index.vue | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/ruler.vue b/src/components/ruler.vue index d68b628..28b16dd 100644 --- a/src/components/ruler.vue +++ b/src/components/ruler.vue @@ -131,8 +131,12 @@ const dots = ref([ // y: 200, // } ]) -const setDot = (dot) => { - dots.value = dot +const setDot = (dot, bol) => { + if (bol) { + dots.value = [] + } else { + dots.value = [...dots.value, ...dot] + } } const lineStyle = ref(null) diff --git a/src/views/index.vue b/src/views/index.vue index a9a9340..519f2d0 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -790,6 +790,7 @@ const ad = () => { const StartWorkBtn = () => { StartWork() + rulerRef.value.setDot([], true) } const StopWorkBtn = () => { StopWork()