2016-11-11 16:06:11 +08:00
|
|
|
---
|
|
|
|
order: 4
|
|
|
|
title:
|
2016-11-22 14:59:09 +08:00
|
|
|
zh-CN: 选择时分
|
|
|
|
en-US: Hour and minute
|
2016-11-11 16:06:11 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
TimePicker 浮层中的列会随着 `format` 变化,当略去 `format` 中的某部分时,浮层中对应的列也会消失。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
While part of `format` is omitted, the corresponding column in panel will disappear, too.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2016-11-11 16:06:11 +08:00
|
|
|
import { TimePicker } from 'antd';
|
2022-02-14 14:40:40 +08:00
|
|
|
import dayjs from 'dayjs';
|
2016-11-11 16:06:11 +08:00
|
|
|
|
|
|
|
const format = 'HH:mm';
|
|
|
|
|
2022-04-13 14:27:29 +08:00
|
|
|
export default () => <TimePicker defaultValue={dayjs('12:08', format)} format={format} />;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|