2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 5
|
2016-08-08 10:40:02 +08:00
|
|
|
title:
|
|
|
|
zh-CN: Flex 对齐
|
|
|
|
en-US: Flex Alignment
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-06-09 22:19:35 +08:00
|
|
|
|
2016-08-08 10:40:02 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-06-15 17:46:42 +08:00
|
|
|
Flex 子元素垂直对齐。
|
2015-06-09 22:19:35 +08:00
|
|
|
|
2016-08-08 10:40:02 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
Flex child elements vertically aligned.
|
|
|
|
|
2015-10-27 23:52:17 +08:00
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Row, Col } from 'antd';
|
2015-10-27 23:52:17 +08:00
|
|
|
|
2016-04-10 15:39:24 +08:00
|
|
|
const DemoBox = props => <p className={`height-${props.value}`}>{props.children}</p>;
|
2015-10-27 23:52:17 +08:00
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<div>
|
2016-08-08 10:40:02 +08:00
|
|
|
<p>Align Top</p>
|
2015-10-28 17:24:35 +08:00
|
|
|
<Row type="flex" justify="center" align="top">
|
2016-09-30 14:24:41 +08:00
|
|
|
<Col span={4}><DemoBox value={100}>col-4</DemoBox></Col>
|
|
|
|
<Col span={4}><DemoBox value={50}>col-4</DemoBox></Col>
|
|
|
|
<Col span={4}><DemoBox value={120}>col-4</DemoBox></Col>
|
|
|
|
<Col span={4}><DemoBox value={80}>col-4</DemoBox></Col>
|
2015-10-27 23:52:17 +08:00
|
|
|
</Row>
|
2015-10-28 20:55:49 +08:00
|
|
|
|
2016-08-08 10:40:02 +08:00
|
|
|
<p>Align Center</p>
|
2015-10-28 17:24:35 +08:00
|
|
|
<Row type="flex" justify="space-around" align="middle">
|
2016-09-30 14:24:41 +08:00
|
|
|
<Col span={4}><DemoBox value={100}>col-4</DemoBox></Col>
|
|
|
|
<Col span={4}><DemoBox value={50}>col-4</DemoBox></Col>
|
|
|
|
<Col span={4}><DemoBox value={120}>col-4</DemoBox></Col>
|
|
|
|
<Col span={4}><DemoBox value={80}>col-4</DemoBox></Col>
|
2015-10-27 23:52:17 +08:00
|
|
|
</Row>
|
2015-10-28 20:55:49 +08:00
|
|
|
|
2016-08-08 10:40:02 +08:00
|
|
|
<p>Align Bottom</p>
|
2015-10-28 17:24:35 +08:00
|
|
|
<Row type="flex" justify="space-between" align="bottom">
|
2016-09-30 14:24:41 +08:00
|
|
|
<Col span={4}><DemoBox value={100}>col-4</DemoBox></Col>
|
|
|
|
<Col span={4}><DemoBox value={50}>col-4</DemoBox></Col>
|
|
|
|
<Col span={4}><DemoBox value={120}>col-4</DemoBox></Col>
|
|
|
|
<Col span={4}><DemoBox value={80}>col-4</DemoBox></Col>
|
2015-10-27 23:52:17 +08:00
|
|
|
</Row>
|
|
|
|
</div>,
|
2015-12-29 12:08:58 +08:00
|
|
|
mountNode
|
2015-10-27 23:52:17 +08:00
|
|
|
);
|
2015-06-09 22:19:35 +08:00
|
|
|
````
|