From e691868a554b306174bba8b72648a74395ebdba6 Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 22 Nov 2023 12:50:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/progress/index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/progress/index.js b/src/progress/index.js index 4ab4d39..a0fd6b9 100644 --- a/src/progress/index.js +++ b/src/progress/index.js @@ -161,10 +161,9 @@ class Progress extends Component { return Math.max(0, Math.min(val, 100)) } - #drawCircle() { + #drawCircle(v) { let offset = OFFSET[this.type] let dash = DASH_ARRAY[this.type] - let v = this.value return html` @@ -198,10 +196,11 @@ class Progress extends Component { } render() { - let step = ~~(this.value / 20) || 1 + let v = this.value + let step = ~~(v / 20) || 1 return html`
- ${this.type === TYPE_LINE ? this.#drawLine() : this.#drawCircle()} + ${this.type === TYPE_LINE ? this.#drawLine(v) : this.#drawCircle(v)}
` }