MineAdmin 交流群

官方QQ群: 150105478

Skip to content

MaTable

A Table component based on Element Plus, which is a secondary encapsulation of the table component. It supports all native table parameters, events, and slots, while enhancing some functionalities, making it very user-friendly.

Note

Since it fully supports and is compatible with all parameters, events, and slots of the native el-table, this documentation will only cover the extended parameters.

For official parameters, please refer to the Element Plus official documentation.

Note: The language pack displayed in the demo component may not be correct, but this issue will not exist in the actual project.

Usage

Props

ParameterDescriptionTypeEle-Website DocumentationVersion
optionsel-table parameters and extended parametersMaTableOptionsTable Attributes1.0.0
columnsel-table-column parameters and extended parametersMaTableColumns[]Table Column Attributes1.0.0
dataTable dataany[]-1.0.0

ExtraProps

Note

These are the extended parameters of ma-table for el-table.

ParameterDescriptionTypeDefaultVersion
containerHeightContainer heightstring-1.0.0
loadingWhether to enable loading animationbooleanfalse1.0.0
loadingConfigConfiguration for loading animationLoadingConfig-1.0.0
columnAlignCell alignmentleft、center、rightcenter1.0.0
headerAlignHover to viewleft、center、right-1.0.0
showOverflowTooltipHover to viewbooleanfalse1.0.0
adaptionWhether to adapt heightbooleanfalse1.0.0
adaptionOffsetBottomBottom offsetnumber701.0.0
showPaginationWhether to show paginationbooleantrue1.0.0
paginationEl-pagination native attributes and eventsel-pageination documentation-1.0.0
onel-table table event collectionHover to view-1.0.0

LoadingConfig Description

ParameterDescriptionTypeDefaultVersion
textLoading text displayed below the loading iconstring-1.0.0
spinnerCustom loading iconstring-1.0.0
svgCustom svg loading iconstring-1.0.0
viewBoxSize of the loading iconstring-1.0.0
backgroundBackground mask colorstring-1.0.0
customClassCustom class namestring-1.0.0

ColumnExtraProps

Note

These are the extended parameters of ma-table for el-table-column.

ParameterDescriptionTypeDefaultVersion
hideWhether to hide the columnbooleanfalse1.0.0
childrenMulti-level headerMaTableColumns[]-1.0.0
cellRenderHover to view(data: TableColumnRenderer) => {}-1.0.0
headerRenderHover to view(data: TableColumnRenderer) => {}-1.0.0

Slot

NameDescriptionParameters
emptyNative slot, displayed when data is empty-
appendNative slot, the last row of the table-
pageLeftSlot for the left area of the pagination row
column-[prop]Table column slot, prop is the field namescope
header-[prop]Table header slot, prop is the field namescope

Event

NameDescriptionParameters
set-data-callbackCallback after setting table datadata: any[]

Expose

NameDescriptionParametersReturn Value
setData()Set table data(any[])-
setPagination()Set pagination parametersEl native parameters-
setLoadingState()Set table loading state(boolean)-
setOptions()Set ma-table configuration(MaTableOptions)-
getOptions()Get ma-table configuration-MaTableOptions
setColumns()Set table columns(MaTableColumns[])-
getColumns()Get table columns-MaTableColumns[]
appendColumn()Append table column(MaTableColumns)-
removeColumn()Remove table column(prop: string)-
getColumnByProp()Get table column by prop(prop: string)MaTableColumns
getElTableRef()Get el-table Ref-El-Table

致力于为品牌和企业创造价值