mirror of https://github.com/ElemeFE/element
79 lines
2.6 KiB
TypeScript
79 lines
2.6 KiB
TypeScript
![]() |
import { ElementUIComponent } from './component'
|
||
|
import { TooltipEffect } from './tooltip'
|
||
|
|
||
|
export type SortOrder = 'ascending' | 'descending'
|
||
|
|
||
|
/** Options to set the default sort column and order */
|
||
|
export interface DefaultSortOptions {
|
||
|
/** Default sort column */
|
||
|
prop: string,
|
||
|
|
||
|
/** Default sort order */
|
||
|
order: SortOrder
|
||
|
}
|
||
|
|
||
|
/** Table Component */
|
||
|
export declare class ElTable extends ElementUIComponent {
|
||
|
/** Table data */
|
||
|
data: object[]
|
||
|
|
||
|
/** Table's height. By default it has an auto height. If its value is a number, the height is measured in pixels; if its value is a string, the height is affected by external styles */
|
||
|
height: string | number
|
||
|
|
||
|
/** Table's max-height. The height of the table starts from auto until it reaches the maxHeight limit. The maxHeight is measured in pixels, same as height */
|
||
|
maxHeight: string | number
|
||
|
|
||
|
/** Whether table is striped */
|
||
|
stripe: boolean
|
||
|
|
||
|
/** Whether table has vertical border */
|
||
|
border: boolean
|
||
|
|
||
|
/** Whether width of column automatically fits its container */
|
||
|
fit: boolean
|
||
|
|
||
|
/** Whether table header is visible */
|
||
|
showHeader: boolean
|
||
|
|
||
|
/** Whether current row is highlighted */
|
||
|
highlightCurrentRow: boolean
|
||
|
|
||
|
/** Key of current row, a set only prop */
|
||
|
currentRowKey: string | number
|
||
|
|
||
|
/** Function that returns custom class names for a row, or a string assigning class names for every row */
|
||
|
rowClassName: string | ((row: object, index: number) => string)
|
||
|
|
||
|
/** Function that returns custom style for a row, or a string assigning custom style for every row */
|
||
|
rowStyle: string | object | ((row: object, index: number) => object)
|
||
|
|
||
|
/** Key of row data, used for optimizing rendering. Required if reserve-selection is on */
|
||
|
rowKey: (row: object) => any
|
||
|
|
||
|
/** Displayed text when data is empty. You can customize this area with `slot="empty"` */
|
||
|
emptyText: String
|
||
|
|
||
|
/** Whether expand all rows by default. Only works when the table has a column `type="expand"` */
|
||
|
defaultExpandAll: Boolean
|
||
|
|
||
|
/** Set expanded rows by this prop. Prop's value is the keys of expand rows, you should set row-key before using this prop */
|
||
|
expandRowKeys: any[]
|
||
|
|
||
|
/** Set the default sort column and order */
|
||
|
defaultSort: DefaultSortOptions
|
||
|
|
||
|
/** Tooltip effect property */
|
||
|
tooltipEffect: TooltipEffect
|
||
|
|
||
|
/** Clear selection. Might be useful when `reserve-selection` is on */
|
||
|
clearSelection (): void
|
||
|
|
||
|
/**
|
||
|
* Toggle or set if a certain row is selected
|
||
|
*
|
||
|
* @param row The row that is going to set its selected state
|
||
|
* @param selected Whether the row is selected. The selected state will be toggled if not set
|
||
|
*/
|
||
|
toggleRowSelection (row: object, selected?: boolean): void
|
||
|
}
|