mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-06 17:18:40 +08:00
parent
9e7c8d33eb
commit
50133b9e5e
@ -56,14 +56,14 @@ const value = ref<number[]>([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 | - |
|
||||
|
||||
|
||||
@ -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 }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user