2016-03-31 09:40:55 +08:00
|
|
|
---
|
2016-11-11 12:08:18 +08:00
|
|
|
order: 2
|
|
|
|
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
|
|
|
|
|
|
|
|
2017-02-13 10:55:53 +08:00
|
|
|
````jsx
|
2016-11-11 12:08:18 +08:00
|
|
|
import { DatePicker, Radio } from 'antd';
|
2017-08-31 20:44:22 +08:00
|
|
|
const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
2016-11-11 12:08:18 +08:00
|
|
|
|
|
|
|
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>
|
2016-11-14 19:13:37 +08:00
|
|
|
</Radio.Group>
|
|
|
|
<br /><br />
|
|
|
|
<DatePicker size={size} />
|
|
|
|
<br />
|
|
|
|
<MonthPicker size={size} />
|
|
|
|
<br />
|
2016-11-11 12:08:18 +08:00
|
|
|
<RangePicker size={size} />
|
2017-08-31 20:44:22 +08:00
|
|
|
<br />
|
|
|
|
<WeekPicker size={size} />
|
2016-11-11 12:08:18 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ReactDOM.render(<PickerSizesDemo />, mountNode);
|
2015-12-10 16:12:10 +08:00
|
|
|
````
|