2016-03-31 09:40:55 +08:00
|
|
|
---
|
2019-12-11 23:32:19 +08:00
|
|
|
order: 11
|
2016-11-11 12:08:18 +08:00
|
|
|
title:
|
2016-06-19 11:17:09 +08:00
|
|
|
zh-CN: 三种大小
|
2016-11-11 12:08:18 +08:00
|
|
|
en-US: Three Sizes
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-12-10 16:12:10 +08:00
|
|
|
|
2016-06-19 11:17:09 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2016-11-11 12:08:18 +08:00
|
|
|
三种大小的输入框,若不设置,则为 `default`。
|
2015-12-10 16:12:10 +08:00
|
|
|
|
2016-06-19 11:17:09 +08:00
|
|
|
## en-US
|
|
|
|
|
2016-11-11 12:08:18 +08:00
|
|
|
The input box comes in three sizes. `default` will be used if `size` is omitted.
|
2016-06-19 11:17:09 +08:00
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2020-07-30 19:17:34 +08:00
|
|
|
import { DatePicker, Radio, Space } from 'antd';
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2019-12-11 23:32:19 +08:00
|
|
|
const { RangePicker } = DatePicker;
|
2016-11-11 12:08:18 +08:00
|
|
|
|
2022-05-11 19:43:54 +08:00
|
|
|
export default () => {
|
|
|
|
const [size, setSize] = React.useState('default');
|
2016-11-11 12:08:18 +08:00
|
|
|
|
2022-05-11 19:43:54 +08:00
|
|
|
const handleSizeChange = e => {
|
|
|
|
setSize(e.target.value);
|
2019-05-07 14:57:32 +08:00
|
|
|
};
|
2016-11-11 12:08:18 +08:00
|
|
|
|
2022-05-11 19:43:54 +08:00
|
|
|
return (
|
|
|
|
<Space direction="vertical" size={12}>
|
|
|
|
<Radio.Group value={size} onChange={handleSizeChange}>
|
|
|
|
<Radio.Button value="large">Large</Radio.Button>
|
|
|
|
<Radio.Button value="default">Default</Radio.Button>
|
|
|
|
<Radio.Button value="small">Small</Radio.Button>
|
|
|
|
</Radio.Group>
|
|
|
|
<DatePicker size={size} />
|
|
|
|
<DatePicker size={size} picker="month" />
|
|
|
|
<RangePicker size={size} />
|
|
|
|
<DatePicker size={size} picker="week" />
|
|
|
|
</Space>
|
|
|
|
);
|
|
|
|
};
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|