ant-design/components/date-picker/demo/suffix.md
二货机器人 64b905e9bd
chore: Update @ant-design/icons deps (#19979)
* update icons deps

* update all icon ref

* fix lint

* update snapshot
2019-11-28 12:34:33 +08:00

49 lines
1.2 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 } from 'antd';
import { SmileOutlined } from '@ant-design/icons';
const smileIcon = <SmileOutlined />;
const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
function onChange(date, dateString) {
console.log(date, dateString);
}
ReactDOM.render(
<div>
<DatePicker suffixIcon={smileIcon} onChange={onChange} />
<br />
<MonthPicker suffixIcon={smileIcon} onChange={onChange} placeholder="Select month" />
<br />
<RangePicker suffixIcon={smileIcon} onChange={onChange} />
<br />
<WeekPicker suffixIcon={smileIcon} onChange={onChange} placeholder="Select week" />
<br />
<DatePicker suffixIcon="ab" onChange={onChange} />
<br />
<MonthPicker suffixIcon="ab" onChange={onChange} placeholder="Select month" />
<br />
<RangePicker suffixIcon="ab" onChange={onChange} />
<br />
<WeekPicker suffixIcon="ab" onChange={onChange} placeholder="Select week" />
</div>,
mountNode,
);
```