DatePicker (日期选择器)
日期 / 日期范围选择器(基于 date-fns),支持格式化、最小/最大值与禁用日期。
基础用法
Value: —
Basic.vue
日期范围
起始:—
结束:—
Range.vue
格式与禁用日期
Value: —
已禁用过去的日期、周六与周日
Format.vue
颜色
Colors.vue
清除与禁用
States.vue 在 Playground 中编辑 查看代码
错误
请选择一个有效的日期
Error.vue 在 Playground 中编辑 查看代码
属性
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| clearable | boolean | true | |
| color | KunUIColor | "default" | |
| darkBorder | boolean | true | |
| disabled | boolean | false | |
| error | string | "" | |
| format | string | "yyyy-MM-dd" | |
| isDateDisabled | ((date: Date) => boolean) | — | |
| label | string | "" | |
| locale | string | — | |
| maxDate | string | Date | — | |
| minDate | string | Date | — | |
| mode | KunDatePickerMode | "single" | |
| modelValue | string | [string | null, string | null] | null | "" | |
| months | string[] | — | |
| placeholder | string | "请选择日期" | |
| rounded | KunUIRounded | undefined | |
| size | KunUISize | "md" | |
| valueFormat | string | "yyyy-MM-dd" | |
| weekdays | string[] | — |