diff --git a/docs/component/slider.md b/docs/component/slider.md index c25e9447..f3fef901 100644 --- a/docs/component/slider.md +++ b/docs/component/slider.md @@ -56,14 +56,14 @@ const value = ref([10, 30]) ## Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | -|-----|---------------------------|-----|-------|-------|--------| +|-----|---------------------------|-----|-------|-------|-------| | v-model | 滑块值,如果为array,则为双向滑块 | number / array | - | - | - | | hide-min-max | 是否显示左右的最大最小值 | boolean | - | false | - | | hide-label | 是否显示当前滑块值 | boolean | - | false | - | | disabled | 是否禁用 | boolean | - | false | - | | max | 最大值 | number | - | 100 | - | | min | 最小值,允许负数`($LOWEST_VERSION$)` | number | - | 0 | - | -| step | 步进值 | number | - | 1 | - | +| step | 步进值 | number | - | 1 | `($LOWEST_VERSION$)` | | active-color | 进度条激活背景颜色 | string | - | linear-gradient(315deg, rgba(81,124,240,1) 0%,rgba(118,158,245,1) 100%) | - | | inactive-color | 进度条未激活背景颜色 | string | - | #e5e5e5 | - | diff --git a/src/uni_modules/wot-design-uni/components/wd-slider/wd-slider.vue b/src/uni_modules/wot-design-uni/components/wd-slider/wd-slider.vue index 9abef8a9..bfa15de4 100644 --- a/src/uni_modules/wot-design-uni/components/wd-slider/wd-slider.vue +++ b/src/uni_modules/wot-design-uni/components/wd-slider/wd-slider.vue @@ -123,9 +123,11 @@ watch( watch( () => props.step, (newValue) => { - if (newValue <= 0) { + if (newValue < 1) { stepValue.value = 1 console.warn('[wot design] warning(wd-slider): step must be greater than 0') + } else { + stepValue.value = Math.floor(newValue) } }, { immediate: true }