# 栅栏
# 基础用法。
Copy
# 设置背景
Copy
# 横向排列
子元素根据不同的值 start
, center
, end
, space-between
, space-around
,分别定义其在父节点里面的排版方式。
居中排列
居前
居后
两边对齐
两边均分对齐
Copy
# 间距
根据 padding
设定子集内边距。 默认设置 1
根据 margin
设定子集外边距。 默认设置 1
不管内边距还是外边距都是以只识别双数。单数会进行四舍五入取双,都是以 8 为基础单位。
Copy
# 适配
根据 flexGrow
设定子集边占比
Copy
# 排列方向
更具 direction
设定排列方向, 可选值row
| row-reverse
| column
| column-reverse
;
column
column-reverse
row
row-reverse
Copy
# 竖向对齐
更具 align-items
设定排列方向, 可选值start
| end
| center
| baseline
| stretch
;
start
end
center
baseline
stretch
Copy
# 可指定方向的边距
根据 padding
margin
指定为数组类型可以定义四边边距
Copy
# API
图片当前只支持线上src,目前图片会根据用户的像素进行切换图片地址。目前添加@2x的图片,上传oss资源时候注意同一文件地址需要上传两份文件(默认大小图片和2x图片)
# row
属性 | 说明 | 类型 | 默认值 | 可选值 | 版本 |
---|---|---|---|---|---|
padding | 内边距 | Number Array | 1.0.0 | ||
margin | 外边距 | Number Array | 1.0.0 | ||
type | 类型 | String | flex | 1.0.0 | |
justify | 对齐模式 | String | start center end space-between space-around | 1.0.0 | |
baseUint | 基础单位 | Number | 8 | 1.0.0 | |
direction | 对齐方向 | String | row row-reverse column column-reverse | 1.0.0 | |
alignItems | 竖向对齐 | Number | start end center baseline stretch | 1.0.0 | |
width | 宽度 | String | 1.0.0 | ||
height | 高度 | String | 1.0.0 |
# col
属性 | 说明 | 类型 | 默认值 | 版本 |
---|---|---|---|---|
width | 宽度 | String | 1.0.0 | |
height | 高度 | String | 1.0.0 | |
flexGrow | 占比 | Number | 1.0.0 |
← 快速上手 布局容器 container →