From d1043eeb038e6f9b9d438fdaa02a691ce71630aa Mon Sep 17 00:00:00 2001 From: zhongnan Date: Wed, 16 Dec 2020 17:56:08 +0800 Subject: [PATCH] fix(slider): fix slide step with max been set --- packages/slider/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/slider/index.ts b/packages/slider/index.ts index efbbc219..88998d73 100644 --- a/packages/slider/index.ts +++ b/packages/slider/index.ts @@ -62,7 +62,7 @@ VantComponent({ this.dragStatus = 'draging'; getRect.call(this, '.van-slider').then((rect) => { - const diff = (this.deltaX / rect.width) * 100; + const diff = (this.deltaX / rect.width) * this.data.max; this.newValue = this.startValue + diff; this.updateValue(this.newValue, false, true); });