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
|
2020-07-30 19:17:34 +08:00
|
|
|
import { DatePicker, Space } 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);
|
|
|
|
}
|
|
|
|
|
2022-04-03 23:27:45 +08:00
|
|
|
export default () => (
|
2020-07-30 19:17:34 +08:00
|
|
|
<Space direction="vertical" size={12}>
|
2018-09-16 19:39:43 +08:00
|
|
|
<DatePicker suffixIcon={smileIcon} onChange={onChange} />
|
2019-12-11 23:32:19 +08:00
|
|
|
<DatePicker suffixIcon={smileIcon} onChange={onChange} picker="month" />
|
2018-09-16 19:39:43 +08:00
|
|
|
<RangePicker suffixIcon={smileIcon} onChange={onChange} />
|
2019-12-11 23:32:19 +08:00
|
|
|
<DatePicker suffixIcon={smileIcon} onChange={onChange} picker="week" />
|
2018-09-16 19:39:43 +08:00
|
|
|
<DatePicker suffixIcon="ab" onChange={onChange} />
|
2019-12-11 23:32:19 +08:00
|
|
|
<DatePicker suffixIcon="ab" onChange={onChange} picker="month" />
|
2018-09-16 19:39:43 +08:00
|
|
|
<RangePicker suffixIcon="ab" onChange={onChange} />
|
2019-12-11 23:32:19 +08:00
|
|
|
<DatePicker suffixIcon="ab" onChange={onChange} picker="week" />
|
2022-04-03 23:27:45 +08:00
|
|
|
</Space>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|