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.