You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.6 KiB
40 lines
1.6 KiB
9 years ago
|
---
|
||
|
category: Components
|
||
|
chinese: 时间选择框
|
||
9 years ago
|
type: Form Controls
|
||
9 years ago
|
english: TimePicker
|
||
|
---
|
||
9 years ago
|
|
||
|
输入或选择时间的控件。
|
||
|
|
||
8 years ago
|
## 何时使用
|
||
9 years ago
|
--------
|
||
|
|
||
|
当用户需要输入一个时间,可以点击标准输入框,弹出时间面板进行选择。
|
||
|
|
||
8 years ago
|
## API
|
||
9 years ago
|
---
|
||
|
|
||
|
```html
|
||
9 years ago
|
<TimePicker defaultValue="13:30:56" />
|
||
9 years ago
|
```
|
||
|
|
||
9 years ago
|
> 注意:`0.11+` 后 `Timepicker` 改名为 `TimePicker`。
|
||
|
|
||
9 years ago
|
| 参数 | 说明 | 类型 | 默认值 |
|
||
|
|---------------------|-----|-----|-------|
|
||
9 years ago
|
| defaultValue | 初始默认时间 | string or Date | 无 |
|
||
|
| value | 默认时间 | string or Date | 无 |
|
||
9 years ago
|
| placeholder | 没有值的时候显示的内容 | string | "请选择时间" |
|
||
9 years ago
|
| onChange | 时间发生变化的回调 | function(date, dateString) | 无 |
|
||
9 years ago
|
| format | 展示的时间格式 | string | "HH:mm:ss"、"HH:mm"、"mm:ss" |
|
||
|
| disabled | 禁用全部操作 | bool | false |
|
||
|
| disabledHours | 禁止选择部分小时选项 | function() | 无 |
|
||
|
| disabledMinutes | 禁止选择部分分钟选项 | function(selectedHour) | 无 |
|
||
|
| disabledSeconds | 禁止选择部分秒选项 | function(selectedHour, selectedMinute) | 无 |
|
||
|
| hideDisabledOptions | 隐藏禁止选择的选项 | boolean | false |
|
||
8 years ago
|
| getPopupContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) | 无 |
|
||
9 years ago
|
| locale | 国际化配置 | Object | [默认配置](https://github.com/ant-design/ant-design/issues/1270#issuecomment-201181384) |
|
||
9 years ago
|
|
||
9 years ago
|
<style>.code-box-demo .ant-time-picker { margin: 0 8px 12px 0; }</style>
|