Skip to content

Table 表格

数据表格,支持列配置、斑马纹、边框等。

基础用法

loading

斑马纹与边框

loading

自定义插槽

通过 #[prop] 可以自定义列的内容,通过 #header-[prop] 可以自定义表头内容。

loading

API

Table Attributes

属性说明类型默认值
data表格数据any[][]
columns列配置TableColumn[][]
stripe是否显示斑马纹booleanfalse
border是否显示外边框与投影booleantrue
rowKey行数据的 Key,用于渲染性能优化或排序`string(row) => string`
showHeader是否显示表头booleantrue

TableColumn Attributes

属性说明类型
prop字段名称string
label显示标题string
width列宽`string
align对齐方式 (leftcenter

Table Slots

名称说明
[prop]对应的列内容插槽,参数为 { row, index }
header-[prop]对应的表头内容插槽,参数为 { column }
empty无数据时的内容插槽

MIT License