mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-02 07:39:36 +08:00
47 lines
1.1 KiB
Markdown
47 lines
1.1 KiB
Markdown
|
---
|
||
|
order: 13
|
||
|
debug: true
|
||
|
title:
|
||
|
zh-CN: 后缀图标
|
||
|
en-US: Suffix
|
||
|
---
|
||
|
|
||
|
## zh-CN
|
||
|
|
||
|
最简单的用法,在浮层中可以选择或者输入日期。
|
||
|
|
||
|
## en-US
|
||
|
|
||
|
Basic use case. Users can select or input a date in panel.
|
||
|
|
||
|
````jsx
|
||
|
import { DatePicker, Icon } from 'antd';
|
||
|
|
||
|
const smileIcon = <Icon type="smile" />;
|
||
|
const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
||
|
|
||
|
function onChange(date, dateString) {
|
||
|
console.log(date, dateString);
|
||
|
}
|
||
|
|
||
|
ReactDOM.render(
|
||
|
<div>
|
||
|
<DatePicker suffix={smileIcon} onChange={onChange} />
|
||
|
<br />
|
||
|
<MonthPicker suffix={smileIcon} onChange={onChange} placeholder="Select month" />
|
||
|
<br />
|
||
|
<RangePicker suffix={smileIcon} onChange={onChange} />
|
||
|
<br />
|
||
|
<WeekPicker suffix={smileIcon} onChange={onChange} placeholder="Select week" />
|
||
|
<br />
|
||
|
<DatePicker suffix="ab" onChange={onChange} />
|
||
|
<br />
|
||
|
<MonthPicker suffix="ab" onChange={onChange} placeholder="Select month" />
|
||
|
<br />
|
||
|
<RangePicker suffix="ab" onChange={onChange} />
|
||
|
<br />
|
||
|
<WeekPicker suffix="ab" onChange={onChange} placeholder="Select week" />
|
||
|
</div>,
|
||
|
mountNode);
|
||
|
````
|