---
name: Flex
title: Flex布局
group: Layout
---

XFlex 是 Flex 布局的控件之一。

## 示例

{% exCode "Layout/XFlex/index.js" %}
{% exView "layout/flex" %}

## API

### XFlex

| 成员        | 说明           | 类型         | 默认值       |
|------------|----------------|-----------|---------------|
| direction    | 子元素排列方向，可选 `row`,`row-reverse`,`column`,`column-reverse`  | String  | `row` |
| wrap    |  子元素的换行方式，可选`nowrap`,`wrap`,`wrap-reverse`  | String  | `nowrap` |
| justify  | 子元素在主轴上的对齐方式，可选`start`,`end`,`center`,`between`,`around`    | String   | `start` |
| align    | 子元素在交叉轴上的对齐方式，可选`start`,`center`,`end`,`baseline`,`stretch` | String   | `center` |
| splitLine | 是否有分割线 | boolean | false|
| itemStyle | 所有子`XFlex.Item`所公用的样式 | Object | {} |
| className | 样式类名 | string | - |

### XFlex.Item

| 成员        | 说明           | 类型         | 默认值       |
|------------|----------------|-----------|---------------|
| splitLine | 是否有分割线 | boolean | false|
| className | 样式类名 | string | - |