From 348c3103b71130815933d25a7fe91806fb5e5375 Mon Sep 17 00:00:00 2001 From: Lick-liu <51771897+Lick-liu@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:40:56 +0800 Subject: [PATCH] fix(van-stepper): fix onChange event exceeded 'max' after setting the max prop (#5741) --- packages/stepper/index.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/stepper/index.ts b/packages/stepper/index.ts index 246ed483..1bebc2f9 100644 --- a/packages/stepper/index.ts +++ b/packages/stepper/index.ts @@ -161,13 +161,7 @@ VantComponent({ return; } - let formatted = this.filter(value); - - // limit max decimal length - if (isDef(this.data.decimalLength) && formatted.indexOf('.') !== -1) { - const pair = formatted.split('.'); - formatted = `${pair[0]}.${pair[1].slice(0, this.data.decimalLength)}`; - } + let formatted = this.format(value); this.emitChange(formatted); },