间距 Space
内置 4 种对齐方式,分别为 start center end baseline,在水平模式下默认为 center。
间距组件的基本用法。
内置 4 个尺寸,mini - 4px small - 8px (默认) medium - 16px large - 24px,也支持传数字来自定义尺寸。
为相邻子元素设置分隔符。
可以设置垂直方向排列的间距。
环绕类型的间距,四周都有间距,一般用于换行的场景。
<space> Props
Section titled “<space> Props”| 参数名 | 描述 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| align | 对齐方式 | 'start' | 'end' | 'center' | 'baseline' | - | |
| direction | 间距方向 | 'vertical' | 'horizontal' | 'horizontal' | |
| size | 间距大小,支持分别制定横向和竖向的间距 | number | 'mini' | 'small' | 'medium' | 'large' | [SpaceSize, SpaceSize] | 'small' | |
| wrap | 环绕类型的间距,用于折行的场景。 | boolean | false | |
| fill | 充满整行 | boolean | false | 2.11.0 |
<space> Slots
Section titled “<space> Slots”| 插槽名 | 描述 | 参数 |
|---|---|---|
| split | 设置分隔符 | - |
type SpaceSize = number | 'mini' | 'small' | 'medium' | 'large';