From fac79a523f4766976fb65ca147889cf39822508a Mon Sep 17 00:00:00 2001 From: taorui Date: Thu, 16 May 2024 10:23:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=BF=9B=E5=BA=A6=E6=9D=A1?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9C=80=E5=B0=8F=E5=80=BC0%=E5=92=8C?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=80=BC100%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/progress/__demo__/ProgressBasic.vue | 12 ++++++++++-- .../src/progress/__demo__/ProgressCircle.vue | 12 ++++++++++-- .../src/progress/__demo__/ProgressColor.vue | 12 ++++++++++-- .../src/progress/__demo__/ProgressCustom.vue | 12 ++++++++++-- .../progress/__demo__/ProgressLabelInside.vue | 12 ++++++++++-- .../progress/__demo__/ProgressStrokeWidth.vue | 18 +++++++++++++----- 6 files changed, 63 insertions(+), 15 deletions(-) diff --git a/packages/opendesign/src/progress/__demo__/ProgressBasic.vue b/packages/opendesign/src/progress/__demo__/ProgressBasic.vue index a09ca187..b2298b9f 100644 --- a/packages/opendesign/src/progress/__demo__/ProgressBasic.vue +++ b/packages/opendesign/src/progress/__demo__/ProgressBasic.vue @@ -9,11 +9,19 @@ import { OIconAdd, OIconMinus } from '../../icon-components'; const val = ref(10); const increaseVal = () => { - val.value += 10; + if (val.value <= 90) { + val.value += 10; + } else { + val.value = 100; + } }; const decreaseVal = () => { - val.value -= 10; + if (val.value >= 10) { + val.value -= 10; + } else { + val.value = 0; + } }; diff --git a/packages/opendesign/src/progress/__demo__/ProgressCircle.vue b/packages/opendesign/src/progress/__demo__/ProgressCircle.vue index 2fbe9499..ef4ba2fc 100644 --- a/packages/opendesign/src/progress/__demo__/ProgressCircle.vue +++ b/packages/opendesign/src/progress/__demo__/ProgressCircle.vue @@ -10,11 +10,19 @@ import { OIconWarning } from '../../icon-components'; const val = ref(60); const increaseVal = () => { - val.value += 10; + if (val.value <= 90) { + val.value += 10; + } else { + val.value = 100; + } }; const decreaseVal = () => { - val.value -= 10; + if (val.value >= 10) { + val.value -= 10; + } else { + val.value = 0; + } }; diff --git a/packages/opendesign/src/progress/__demo__/ProgressColor.vue b/packages/opendesign/src/progress/__demo__/ProgressColor.vue index d55e3edf..8d8b9120 100644 --- a/packages/opendesign/src/progress/__demo__/ProgressColor.vue +++ b/packages/opendesign/src/progress/__demo__/ProgressColor.vue @@ -9,11 +9,19 @@ import { OIconAdd, OIconMinus } from '../../icon-components'; const val = ref(60); const increaseVal = () => { - val.value += 10; + if (val.value <= 90) { + val.value += 10; + } else { + val.value = 100; + } }; const decreaseVal = () => { - val.value -= 10; + if (val.value >= 10) { + val.value -= 10; + } else { + val.value = 0; + } }; diff --git a/packages/opendesign/src/progress/__demo__/ProgressCustom.vue b/packages/opendesign/src/progress/__demo__/ProgressCustom.vue index 92870bf4..9febc2f6 100644 --- a/packages/opendesign/src/progress/__demo__/ProgressCustom.vue +++ b/packages/opendesign/src/progress/__demo__/ProgressCustom.vue @@ -11,11 +11,19 @@ import { OIconWarning } from '../../icon-components'; const val = ref(10); const increaseVal = () => { - val.value += 10; + if (val.value <= 90) { + val.value += 10; + } else { + val.value = 100; + } }; const decreaseVal = () => { - val.value -= 10; + if (val.value >= 10) { + val.value -= 10; + } else { + val.value = 0; + } }; const format = (percentage: number) => { diff --git a/packages/opendesign/src/progress/__demo__/ProgressLabelInside.vue b/packages/opendesign/src/progress/__demo__/ProgressLabelInside.vue index c7950a48..c70bd2a3 100644 --- a/packages/opendesign/src/progress/__demo__/ProgressLabelInside.vue +++ b/packages/opendesign/src/progress/__demo__/ProgressLabelInside.vue @@ -9,11 +9,19 @@ import { OIconAdd, OIconMinus } from '../../icon-components'; const val = ref(30); const increaseVal = () => { - val.value += 10; + if (val.value <= 90) { + val.value += 10; + } else { + val.value = 100; + } }; const decreaseVal = () => { - val.value -= 10; + if (val.value >= 10) { + val.value -= 10; + } else { + val.value = 0; + } }; diff --git a/packages/opendesign/src/progress/__demo__/ProgressStrokeWidth.vue b/packages/opendesign/src/progress/__demo__/ProgressStrokeWidth.vue index 99087ade..3263017d 100644 --- a/packages/opendesign/src/progress/__demo__/ProgressStrokeWidth.vue +++ b/packages/opendesign/src/progress/__demo__/ProgressStrokeWidth.vue @@ -9,11 +9,19 @@ import { OIconAdd, OIconMinus } from '../../icon-components'; const val = ref(60); const increaseVal = () => { - val.value += 10; + if (val.value <= 90) { + val.value += 10; + } else { + val.value = 100; + } }; const decreaseVal = () => { - val.value -= 10; + if (val.value >= 10) { + val.value -= 10; + } else { + val.value = 0; + } }; @@ -36,9 +44,9 @@ const decreaseVal = () => {
- - - + + +
-- Gitee