Skip to content

表格(SchemaTable) ​

/web/src/components/schemaTable/SchemaTable.vue该组件对 Element Plus 的 Table 表格 和 Pagination 分页 进行了二次封装,提供了默认的表格布局、操作按钮、分页等功能,以及完全使用 TypeScript 编写的动态表格功能。

示例:/web/src/views/demo/SchemaTableDemo.vue

API ​

Attributes ​

参数说明类型默认值必填
v-model分页属性Pagination是
table表格配置,T 为 FormModel类型的参数SchemaTable<T extends FormModel>是

Slots ​

参数说明类型
default表格操作列{ row: any, column: any, $index: number }

类型声明 ​

/web/src/components/schemaTable/types/index.d.ts

Pagination ​

参数说明类型默认值必填
pageSize页大小number是
currentPage当前页码number是
total总条数number是

SchemaTable ​

参数说明类型默认值必填
props表格属性TableProps<T>-是
events表格事件,与 Element Plus 的 Table 事件 属性-否
columns以表格数据的key ,作为表格各列的key, 值为去除prop属性的 Element Plus 的 Table-column 属性否
actionsProps表格操作列属性,与去除prop属性的 Element Plus 的 Table-column 属性一致-否
pagination分页属性PaginationProps-否

TableProps ​

继承了 Element Plus 的 Table 属性,删除了data属性,并添加了以下属性:

参数说明类型默认值必填
data表数据,提供了类型提示T[]-是
loading是否显示表格加载中boolean-否
showSelection是否显示多选框boolean-否

PaginationProps ​

参数说明类型默认值必填
propsElement Plus 的 Pagination 分页属性,去除了pageSize、currentPage、defaultPageSize、defaultCurrentPage、total、pageCount-否
eventsElement Plus 的 Pagination 分页事件-否

Released under the MIT License.