1.0.14 • Published 3 years ago

vue-common-table v1.0.14

Weekly downloads
26
License
MIT
Repository
github
Last release
3 years ago

vue-common-table

基于 elementUI 封装的 table 组件,支持所有 elementUI table 组件配置项 文档,另外多选功能做了跨分页多选

Attributes

参数说明类型默认值
data表格数据Array-
columns列配置,详情见下方 Column 属性Array-
loading加载状态Booleanfalse
config表格配置项,详情见下方 Config 属性Object-
page分页参数,包括:size,total,currentPage,不传时不显示分页器Objectnull
pageConfig分页器配置项,详情见下方 PageConfig 属性Object-

Column Attributes

除此之外支持所有 el-table-column attributes

参数说明类型默认值
slot开启 slot 支持,用于自定义列Booleanfalse

Config Attributes

除此之外支持所有 el-table attributes

参数说明类型默认值
enableMultiSelect是否支持多选Booleanfalse
showHandler是否显示操作列Booleanfalse
handlerColumn操作列配置,showHandler 为 true 时有效Objext{label: '操作',minWidth: 100,fixed: 'right'}
highlightSelect是否高亮选中行,仅多选时有效Booleantrue
showIndexColumn是否显示序号列Booleanfalse
rowKey行数据的 Key,用来优化 Table 的渲染;在使用 多选 功能与显示树形数据时,该属性是必填的。类型为 String 时,支持多层访问:user.info.id,但不支持 user.info0.id,此种情况请使用 Function。Function(row)/String--

PageConfig Attributes

除此之外支持所有 el-pagination attributes

参数说明类型默认值
customClassName自定义分页器 classNameString-

Slot

name说明参数
列的 prop 值自定义列的内容,当列的 slot 属性设置为 true 时有效{ row, column, \$index }
列的 prop 值 + '-header'自定义表头的内容,当列的 slot 属性设置为 true 时有效{ column, \$index }
handler自定义操作栏的内容{ row, column, \$index }
multiSelectMenu自定义多选操作列内容,enableMultiSelect 为 true 时有效,勾选行时显示{ selection }
topMenu自定义顶部操作,勾选行时不显示-

Events

除此之外支持所有 el-table events

注: 因为添加了跨分页多选的功能,selection-change会在切换分页设置勾选状态时调用多次

事件名称说明参数
current-page-changecurrentPage 改变时会触发当前页
page-size-changepageSize 改变时会触发每页条数

Methods

支持所有 el-table 的 methods

1.0.14

3 years ago

1.0.13

3 years ago

1.0.11

3 years ago

1.0.12

3 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago