2018-09-14 22:50:35 +08:00
|
|
|
---
|
2019-12-11 23:32:19 +08:00
|
|
|
order: 99
|
2018-09-14 22:50:35 +08:00
|
|
|
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
|
2019-08-13 14:07:17 +08:00
|
|
|
import { DatePicker } from 'antd';
|
2019-11-28 12:34:33 +08:00
|
|
|
import { SmileOutlined } from '@ant-design/icons';
|
2018-09-14 22:50:35 +08:00
|
|
|
|
2019-11-28 12:34:33 +08:00
|
|
|
const smileIcon = <SmileOutlined />;
|
2019-12-11 23:32:19 +08:00
|
|
|
const { RangePicker } = DatePicker;
|
2018-09-14 22:50:35 +08:00
|
|
|
|
|
|
|
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 />
|
2019-12-11 23:32:19 +08:00
|
|
|
<DatePicker suffixIcon={smileIcon} onChange={onChange} picker="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 />
|
2019-12-11 23:32:19 +08:00
|
|
|
<DatePicker suffixIcon={smileIcon} onChange={onChange} picker="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 />
|
2019-12-11 23:32:19 +08:00
|
|
|
<DatePicker suffixIcon="ab" onChange={onChange} picker="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 />
|
2019-12-11 23:32:19 +08:00
|
|
|
<DatePicker suffixIcon="ab" onChange={onChange} picker="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
|
|
|
```
|