time-picker
install
npm install vtime-picker --save
or
yarn add vtime-picker
how to use ?
running the examples like below:
1.cd to the vtime-picker/
2.npm install/yarn install
3.open the url:localhost: 8080
API
props | desciption | type | default value |
---|---|---|---|
allowEmpty | 是否允许不pick | boolean | true |
autoFocus | 自动获取焦点 | boolean | false |
className | 选择器类名 | string | '' |
clearText | 清除按钮的提示文案 | string | 清空 |
defaultValue | 默认时间 | { // 24时制 hour:, minute:, second:, } | 00:00:00 |
disabled | 禁用全部操作 | boolean | false |
disabledHours | 禁止选择部分小时选项 | function() | null |
disabledMinutes | 禁止选择部分分钟选项 | function() | null |
disabledSeconds | 禁止选择部分秒选项 | function() | null |
format | 展示的时间格式 | hh:mm:ss / hh:mm / mm:ss s / hh:mm:ss | hh:mm:ss |
hideDisabledOptions | 隐藏禁止选择的选项 | boolean | false |
hourStep | 小时选项间隔 | number | 1 |
minuteStep | 分钟选项间隔 | number | 1 |
secondStep | 秒选项间隔 | number | 1 |
inputReadOnly | 设置输入框为只读(避免在移动设备上打开虚拟键盘) | boolean | true |
open | 面板是否打开 | boolean | false |
placeholder | 没有值的时候显示的内容 | string | 请选择时间 |
use12Hours | 使用 12 小时制,为 true 时 format 默认为 h:mm:ss a/pm | boolean | false |
@tpOnChange | 当输入框值变化时触发 | -- | -- |
@tpOnOpenChange | 当选择器状态变化时(show or hide)触发 | -- | -- |