You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.3 KiB
50 lines
1.3 KiB
9 years ago
|
---
|
||
|
order: 5
|
||
8 years ago
|
title:
|
||
|
zh-CN: Flex 对齐
|
||
|
en-US: Flex Alignment
|
||
9 years ago
|
---
|
||
10 years ago
|
|
||
8 years ago
|
## zh-CN
|
||
|
|
||
10 years ago
|
Flex 子元素垂直对齐。
|
||
10 years ago
|
|
||
8 years ago
|
## en-US
|
||
|
|
||
|
Flex child elements vertically aligned.
|
||
|
|
||
9 years ago
|
````jsx
|
||
9 years ago
|
import { Row, Col } from 'antd';
|
||
9 years ago
|
|
||
9 years ago
|
const DemoBox = props => <p className={`height-${props.value}`}>{props.children}</p>;
|
||
9 years ago
|
|
||
|
ReactDOM.render(
|
||
|
<div>
|
||
8 years ago
|
<p>Align Top</p>
|
||
9 years ago
|
<Row type="flex" justify="center" align="top">
|
||
8 years ago
|
<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>
|
||
9 years ago
|
</Row>
|
||
9 years ago
|
|
||
8 years ago
|
<p>Align Center</p>
|
||
9 years ago
|
<Row type="flex" justify="space-around" align="middle">
|
||
8 years ago
|
<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>
|
||
9 years ago
|
</Row>
|
||
9 years ago
|
|
||
8 years ago
|
<p>Align Bottom</p>
|
||
9 years ago
|
<Row type="flex" justify="space-between" align="bottom">
|
||
8 years ago
|
<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>
|
||
9 years ago
|
</Row>
|
||
|
</div>,
|
||
9 years ago
|
mountNode
|
||
9 years ago
|
);
|
||
10 years ago
|
````
|