FxDescriptions 描述列表
列表形式展示字段与值,支持 column 列数切分、direction 方向、border 边框、size 尺寸、title / extra 标题与操作区,以及 item 级 span / rowspan / width / align 等细粒度控制。
基础用法
尺寸
通过 size 配合 border 切换尺寸,#extra 插槽放置操作按钮,#label 插槽自定义 label(含图标)。
竖直列表
direction="vertical" 时 label 与 content 上下排列,:span="2" 跨列。
跨行
:rowspan="2" 跨行,horizontal 与 vertical 两种方向下的效果。
自定义样式
通过 label-align / align / label-class-name / class-name / width 自定义样式。
Descriptions API
Attributes
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| border | 是否显示边框(带边框时 label / content 分列两单元格) | boolean | false |
| column | 一行内 Descriptions Item 的数量 | number | 3 |
| direction | 列表方向 | 'horizontal' | 'vertical' | 'horizontal' |
| size | 列表尺寸,省略时走 form / config-provider | 'large' | 'default' | 'small' | '' | '' |
| title | 标题文字,显示在左上 | string | '' |
| extra | 操作区文字,显示在右上 | string | '' |
| labelWidth | 每列 label 的宽度,优先级低于 item 自身的 labelWidth | string | number | — |
Slots
| 插槽名 | 说明 |
|---|---|
| default | 放置 FxDescriptionsItem 子项 |
| title | 自定义标题,替代 title prop |
| extra | 自定义操作区,替代 extra prop |
DescriptionsItem API
Attributes
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| label | label 文字 | string | '' |
| span | 该 item 跨多少列(colspan) | number | 1 |
| rowspan | 该 item 跨多少行(仅 horizontal + border 下生效) | number | 1 |
| width | 列宽(同一列取最大值;无 border 时含 label + content) | string | number | '' |
| minWidth | 列最小宽度(按比例分配,有 width 的列固定) | string | number | '' |
| labelWidth | label 列宽,优先级高于父 Descriptions 的 labelWidth | string | number | — |
| align | content 对齐;无 border 时同时作用于 label | 'left' | 'center' | 'right' | 'left' |
| labelAlign | label 对齐,省略时回退到 align | 'left' | 'center' | 'right' | — |
| className | content 自定义类名 | string | '' |
| labelClassName | label 自定义类名 | string | '' |
Slots
| 插槽名 | 说明 |
|---|---|
| default | 自定义 content |
| label | 自定义 label(含图标等富内容) |
