mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-08 20:38:39 +08:00
20 lines
366 B
Markdown
20 lines
366 B
Markdown
# 日期时间选择
|
|
|
|
- order: 4
|
|
|
|
增加选择时间功能。
|
|
|
|
---
|
|
|
|
````jsx
|
|
import { DatePicker } from 'antd';
|
|
|
|
function onChange(value) {
|
|
console.log('选择了时间:', value);
|
|
}
|
|
|
|
ReactDOM.render(
|
|
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" onChange={onChange} style={{width: 160}} />
|
|
, document.getElementById('components-date-picker-demo-time'));
|
|
````
|