mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 08:59:15 +08:00
5a08aab0e8
* docs: DatePicker change type demo * chore: snapshot * chore * docs: DatePicker use Space * chore: snapshot
50 lines
1.1 KiB
Markdown
50 lines
1.1 KiB
Markdown
---
|
|
order: 11
|
|
title:
|
|
zh-CN: 三种大小
|
|
en-US: Three Sizes
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
三种大小的输入框,若不设置,则为 `default`。
|
|
|
|
## en-US
|
|
|
|
The input box comes in three sizes. `default` will be used if `size` is omitted.
|
|
|
|
```jsx
|
|
import { DatePicker, Radio, Space } from 'antd';
|
|
|
|
const { RangePicker } = DatePicker;
|
|
|
|
class PickerSizesDemo extends React.Component {
|
|
state = {
|
|
size: 'default',
|
|
};
|
|
|
|
handleSizeChange = e => {
|
|
this.setState({ size: e.target.value });
|
|
};
|
|
|
|
render() {
|
|
const { size } = this.state;
|
|
return (
|
|
<Space direction="vertical" size={12}>
|
|
<Radio.Group value={size} onChange={this.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>
|
|
);
|
|
}
|
|
}
|
|
|
|
ReactDOM.render(<PickerSizesDemo />, mountNode);
|
|
```
|