mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-21 13:18:04 +08:00
f3911b3707
* New Component WeekPicker close #212 * Add WeexPicker in API doc * update snapshot * Add test cases * update snapshot
54 lines
1.1 KiB
Markdown
54 lines
1.1 KiB
Markdown
---
|
|
order: 2
|
|
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 } from 'antd';
|
|
const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
|
|
|
class PickerSizesDemo extends React.Component {
|
|
state = {
|
|
size: 'default',
|
|
};
|
|
|
|
handleSizeChange = (e) => {
|
|
this.setState({ size: e.target.value });
|
|
}
|
|
|
|
render() {
|
|
const { size } = this.state;
|
|
return (
|
|
<div>
|
|
<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>
|
|
<br /><br />
|
|
<DatePicker size={size} />
|
|
<br />
|
|
<MonthPicker size={size} />
|
|
<br />
|
|
<RangePicker size={size} />
|
|
<br />
|
|
<WeekPicker size={size} />
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
ReactDOM.render(<PickerSizesDemo />, mountNode);
|
|
````
|