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()