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)}
` }