2016-03-31 09:40:55 +08:00
---
order: 4
2016-09-30 14:24:41 +08:00
title:
2016-08-08 10:40:02 +08:00
zh-CN: Flex 布局
en-US: Flex Layout
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
使用 `row-flex` 定义 `flex` 布局,其子元素根据不同的值 `start` ,`center`,`end`,`space-between`,`space-around`,分别定义其在父节点里面的排版方式。
2016-08-08 10:40:02 +08:00
## 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.
2017-02-13 10:55:53 +08:00
````jsx
2015-10-28 20:55:49 +08:00
import { Row, Col } from 'antd';
2015-10-27 23:52:17 +08:00
ReactDOM.render(
< div >
2016-08-08 10:40:02 +08:00
< p > sub-element align left< / p >
2015-10-28 17:24:35 +08:00
< Row type = "flex" justify = "start" >
2016-09-30 14:24:41 +08:00
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / 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 > sub-element align center< / p >
2015-10-28 17:24:35 +08:00
< Row type = "flex" justify = "center" >
2016-09-30 14:24:41 +08:00
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
2015-10-27 23:52:17 +08:00
< / Row >
2016-08-08 10:40:02 +08:00
< p > sub-element align right< / p >
2015-10-28 17:24:35 +08:00
< Row type = "flex" justify = "end" >
2016-09-30 14:24:41 +08:00
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
2015-10-27 23:52:17 +08:00
< / Row >
2016-08-08 10:40:02 +08:00
< p > sub-element monospaced arrangement< / p >
2015-10-28 17:24:35 +08:00
< Row type = "flex" justify = "space-between" >
2016-09-30 14:24:41 +08:00
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
2015-10-27 23:52:17 +08:00
< / Row >
2016-08-08 10:40:02 +08:00
< p > sub-element align full< / p >
2015-10-28 17:24:35 +08:00
< Row type = "flex" justify = "space-around" >
2016-09-30 14:24:41 +08:00
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
< Col span = {4} > col-4< / Col >
2015-10-27 23:52:17 +08:00
< / Row >
< / div > ,
2015-12-29 12:08:58 +08:00
mountNode
2015-11-25 17:35:49 +08:00
);
2015-06-09 22:19:35 +08:00
````