Slider (滑块)
范围滑块(v-model number),支持 min / max / step。
基础用法
Value: 40
Basic.vue
颜色
default
primary
secondary
success
warning
danger
info
Colors.vue
尺寸
xs
sm
md
lg
xl
Sizes.vue
刻度
number[] 刻度
带标签的刻度
Marks.vue
提示气泡与数值
40
Tooltip.vue
步长
50
Step.vue
状态
数值超出范围
States.vue
属性
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| modelValue * | number | — | |
| ariaLabel | string | — | Accessible name when there is no visible label (role="slider" needs a name). |
| color | KunUIColor | "primary" | |
| description | string | — | Helper text below the track (hidden when `error` is set). |
| disabled | boolean | false | |
| error | string | — | Error message (red text below + danger fill). Takes precedence over description. |
| formatValue | ((value: number) => string) | — | Format the value shown in the tooltip / value readout. |
| label | string | — | Visible field label (rendered above the track, associates the slider). |
| marks | (number | KunSliderMark)[] | — | Tick marks under the track. Pass numbers (or {value,label}) within [min,max]. |
| max | number | 100 | |
| min | number | 0 | |
| showTooltip | boolean | false | Show a value bubble above the thumb while hovering / dragging / focused. |
| showValue | boolean | false | Always render the current value next to the label. |
| size | KunUISize | "md" | |
| step | number | 1 |
事件
| 事件 | 回调参数 | 说明 |
|---|---|---|
| change | value: number | Fired once on commit (pointer release / keyboard), for forms that only care about the final value — `update:modelValue` still streams live. |
| update:modelValue | value: number |