2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 0
|
2016-06-19 11:17:09 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 基本
|
|
|
|
en-US: Basic
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-12-10 16:12:10 +08:00
|
|
|
|
2016-06-19 11:17:09 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2016-11-11 12:08:18 +08:00
|
|
|
最简单的用法,在浮层中可以选择或者输入日期。
|
2015-12-10 16:12:10 +08:00
|
|
|
|
2016-06-19 11:17:09 +08:00
|
|
|
## en-US
|
|
|
|
|
2016-11-11 12:08:18 +08:00
|
|
|
Basic use case. Users can select or input a date in panel.
|
2016-06-19 11:17:09 +08:00
|
|
|
|
2015-12-10 16:12:10 +08:00
|
|
|
````jsx
|
2017-01-04 10:48:40 +08:00
|
|
|
import { DatePicker, Badge } from 'antd';
|
2016-11-11 12:08:18 +08:00
|
|
|
const { MonthPicker, RangePicker } = DatePicker;
|
2015-12-10 16:12:10 +08:00
|
|
|
|
2016-09-09 13:55:21 +08:00
|
|
|
function onChange(date, dateString) {
|
|
|
|
console.log(date, dateString);
|
2015-12-25 01:21:03 +08:00
|
|
|
}
|
|
|
|
|
2016-11-11 12:08:18 +08:00
|
|
|
ReactDOM.render(
|
|
|
|
<div>
|
2016-11-23 11:23:18 +08:00
|
|
|
<DatePicker onChange={onChange} />
|
|
|
|
<br />
|
2017-01-04 11:00:58 +08:00
|
|
|
<MonthPicker onChange={onChange} />
|
2016-11-23 11:23:18 +08:00
|
|
|
<br />
|
2016-11-11 12:08:18 +08:00
|
|
|
<RangePicker onChange={onChange} />
|
2016-11-14 19:13:37 +08:00
|
|
|
</div>
|
|
|
|
, mountNode);
|
2015-12-10 16:12:10 +08:00
|
|
|
````
|