Skip to content

Commit dd9c85f

Browse files
author
daiwanxing
committed
fix(range): 修复使用 step 时未考虑 min 值的处理
1 parent c98a1ee commit dd9c85f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/packages/__VUE/range/index.taro.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export default create({
272272
const format = (value: number) => {
273273
const { min, max, step } = props
274274
value = Math.max(+min, Math.min(value, +max))
275-
return Math.round(value / +step) * +step
275+
return Math.round((value - +min) / +step) * +step + +min
276276
}
277277
278278
const isSameValue = (newValue: SliderValue, oldValue: SliderValue) =>

0 commit comments

Comments
 (0)