时间选择器
用法
设置默认值
通过 defaultValue
选项设置默认值,设置为 'now'
可以将默认值设置为页面显示的时刻。
格式化
通过 format
选项设置日期格式化形式,支持日期辅助方法 formatDate
中的所有格式。
选项
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
id | string | null | 组件根元素的 ID。 |
className | any | null | 组件根元素的类名。 |
style | object | null | 组件根元素的样式。 |
tagName | string | null | 组件根元素的标签名。 |
attrs | object | null | 附加到组件根元素上的属性。 |
clickType | 'toggle' 'open' | null | 点击类型,toggle 表示点击按钮时切换显示隐藏,open 表示点击按钮时只打开。 |
name | string | null | 作为表单项的名称。 |
defaultValue | string 'today' | null | 初始默认颜色值。 |
onChange | function | null | 颜色值变更时的回调函数 |
disabled | boolean | null | 是否禁用。 |
readonly | boolean | null | 是否只读,不允许手动修改。 |
required | boolean | null | 是否必须提供值(不能清除和选择空值)。 |
placeholder | string | null | 输入框上占位文本。 |
format | string | null | 时间格式,默认 hh:mm。 |
minuteStep | number | — | 分钟选择间隔,默认 5(分钟)。 |
icon | string boolean | null | 在输入框右侧显示的图标。 |
onInvalid | function | null | 时间值无效时的回调函数。 |