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.
66 lines
1.6 KiB
66 lines
1.6 KiB
9 years ago
|
---
|
||
|
order: 4
|
||
8 years ago
|
title:
|
||
8 years ago
|
zh-CN: Flex 布局
|
||
|
en-US: Flex Layout
|
||
9 years ago
|
---
|
||
10 years ago
|
|
||
8 years ago
|
## zh-CN
|
||
|
|
||
10 years ago
|
Flex 布局基础。
|
||
10 years ago
|
|
||
|
使用 `row-flex` 定义 `flex` 布局,其子元素根据不同的值 `start`,`center`,`end`,`space-between`,`space-around`,分别定义其在父节点里面的排版方式。
|
||
|
|
||
8 years ago
|
## en-US
|
||
|
|
||
|
Use `row-flex` define` flex` layout, its child elements depending on the value of the `start`,` center`, `end`,` space-between`, `space-around`, which are defined in its parent node layout mode.
|
||
|
|
||
9 years ago
|
````jsx
|
||
9 years ago
|
import { Row, Col } from 'antd';
|
||
9 years ago
|
|
||
|
ReactDOM.render(
|
||
|
<div>
|
||
8 years ago
|
<p>sub-element align left</p>
|
||
9 years ago
|
<Row type="flex" justify="start">
|
||
8 years ago
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
9 years ago
|
</Row>
|
||
9 years ago
|
|
||
8 years ago
|
<p>sub-element align center</p>
|
||
9 years ago
|
<Row type="flex" justify="center">
|
||
8 years ago
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
9 years ago
|
</Row>
|
||
|
|
||
8 years ago
|
<p>sub-element align right</p>
|
||
9 years ago
|
<Row type="flex" justify="end">
|
||
8 years ago
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
9 years ago
|
</Row>
|
||
|
|
||
8 years ago
|
<p>sub-element monospaced arrangement</p>
|
||
9 years ago
|
<Row type="flex" justify="space-between">
|
||
8 years ago
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
9 years ago
|
</Row>
|
||
|
|
||
8 years ago
|
<p>sub-element align full</p>
|
||
9 years ago
|
<Row type="flex" justify="space-around">
|
||
8 years ago
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
|
<Col span={4}>col-4</Col>
|
||
9 years ago
|
</Row>
|
||
|
</div>,
|
||
9 years ago
|
mountNode
|
||
9 years ago
|
);
|
||
10 years ago
|
````
|