From 3a546cce8e0ef6355ccda444b40db39343bae841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=87=E9=98=B3?= Date: Sat, 14 Sep 2024 16:57:47 +0800 Subject: [PATCH] fix(Slider): range mode not use on value is empty array --- src/slider/slider.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slider/slider.tsx b/src/slider/slider.tsx index 482c14098..7a95ce4dc 100644 --- a/src/slider/slider.tsx +++ b/src/slider/slider.tsx @@ -228,8 +228,8 @@ export default mixins(classPrefixMixins).extend({ const { min, max, value } = this; if (this.range) { if (Array.isArray(value)) { - this.firstValue = Math.max(min || 0, value[0]); - this.secondValue = Math.min(max || 100, value[1]); + this.firstValue = Math.max(min || 0, value[0] ?? 0); + this.secondValue = Math.min(max || 100, value[1] ?? 0); } else { this.firstValue = min || 0; this.secondValue = max || 100;