mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 09:39:10 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
41 lines
1.1 KiB
Markdown
41 lines
1.1 KiB
Markdown
---
|
|
order: 99
|
|
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, Space } from 'antd';
|
|
import { SmileOutlined } from '@ant-design/icons';
|
|
|
|
const smileIcon = <SmileOutlined />;
|
|
const { RangePicker } = DatePicker;
|
|
|
|
function onChange(date, dateString) {
|
|
console.log(date, dateString);
|
|
}
|
|
|
|
export default () => (
|
|
<Space direction="vertical" size={12}>
|
|
<DatePicker suffixIcon={smileIcon} onChange={onChange} />
|
|
<DatePicker suffixIcon={smileIcon} onChange={onChange} picker="month" />
|
|
<RangePicker suffixIcon={smileIcon} onChange={onChange} />
|
|
<DatePicker suffixIcon={smileIcon} onChange={onChange} picker="week" />
|
|
<DatePicker suffixIcon="ab" onChange={onChange} />
|
|
<DatePicker suffixIcon="ab" onChange={onChange} picker="month" />
|
|
<RangePicker suffixIcon="ab" onChange={onChange} />
|
|
<DatePicker suffixIcon="ab" onChange={onChange} picker="week" />
|
|
</Space>
|
|
);
|
|
```
|