ant-design/components/input/demo/size.md

27 lines
576 B
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
2016-05-25 18:21:27 +08:00
order: 1
title: 三种大小
2016-03-31 09:40:55 +08:00
---
2015-10-29 08:41:51 +08:00
2016-05-25 18:21:27 +08:00
我们为 `<Input />` 输入框定义了三种尺寸(大、默认、小),高度分别为 `32px`、`28px` 和 `22px`
2015-10-29 08:41:51 +08:00
2016-05-25 18:21:27 +08:00
注意: 在表单里面,我们只使用大尺寸的输入框。
2015-10-29 08:41:51 +08:00
````jsx
2016-05-19 14:43:10 +08:00
import { Input } from 'antd';
2015-10-29 08:41:51 +08:00
ReactDOM.render(
2016-05-19 14:43:10 +08:00
<div className="example-input">
<Input size="large" placeholder="大尺寸" />
<Input placeholder="默认尺寸" />
<Input size="small" placeholder="小尺寸" />
</div>
, mountNode);
2015-10-29 08:41:51 +08:00
````
2016-05-19 14:43:10 +08:00
````css
.example-input .ant-input {
2016-05-25 18:21:27 +08:00
width: 200px;
margin: 0 8px 8px 0;
2016-05-19 14:43:10 +08:00
}
2016-05-25 18:21:27 +08:00
````