ant-design/components/date-picker/demo/suffix.md

48 lines
1.1 KiB
Markdown
Raw Normal View History

2018-09-14 22:50:35 +08:00
---
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.
2019-05-07 14:57:32 +08:00
```jsx
2018-09-14 22:50:35 +08:00
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>
2018-09-16 19:39:43 +08:00
<DatePicker suffixIcon={smileIcon} onChange={onChange} />
2018-09-14 22:50:35 +08:00
<br />
2018-09-16 19:39:43 +08:00
<MonthPicker suffixIcon={smileIcon} onChange={onChange} placeholder="Select month" />
2018-09-14 22:50:35 +08:00
<br />
2018-09-16 19:39:43 +08:00
<RangePicker suffixIcon={smileIcon} onChange={onChange} />
2018-09-14 22:50:35 +08:00
<br />
2018-09-16 19:39:43 +08:00
<WeekPicker suffixIcon={smileIcon} onChange={onChange} placeholder="Select week" />
2018-09-14 22:50:35 +08:00
<br />
2018-09-16 19:39:43 +08:00
<DatePicker suffixIcon="ab" onChange={onChange} />
2018-09-14 22:50:35 +08:00
<br />
2018-09-16 19:39:43 +08:00
<MonthPicker suffixIcon="ab" onChange={onChange} placeholder="Select month" />
2018-09-14 22:50:35 +08:00
<br />
2018-09-16 19:39:43 +08:00
<RangePicker suffixIcon="ab" onChange={onChange} />
2018-09-14 22:50:35 +08:00
<br />
2018-09-16 19:39:43 +08:00
<WeekPicker suffixIcon="ab" onChange={onChange} placeholder="Select week" />
2018-09-14 22:50:35 +08:00
</div>,
2019-05-07 14:57:32 +08:00
mountNode,
2018-11-28 15:00:03 +08:00
);
2019-05-07 14:57:32 +08:00
```