保誠-保戶業務員媒合平台
tomasysh
2025-01-02 4efb98f2b554b76270b12837db7a7f724e2ede89
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { CreateElement, VNode } from 'vue'
import { ElementUIComponent, ElementUIHorizontalAlignment } from './component'
import { PopoverPlacement } from './popover'
 
export type TableColumnType = 'default' | 'selection' | 'index' | 'expand'
export type TableColumnFixedType = 'left' | 'right'
export type SortOrders = 'ascending' | 'descending' | null
 
export type TableColumn = {
  /** Label of the column */
  label: string,
 
  /** Property name of the source data */
  property: string,
 
  /** Type of the column */
  type: string,
 
  /** Whether column is fixed at left/right */
  fixed: boolean | string
}
 
/** Data used in renderHeader function */
export interface RenderHeaderData {
  /** The column that is current rendering */
  column: any,
 
  /** The index of the rendering column */
  $index: number
}
 
/** Filter Object */
export interface TableColumnFilter {
  /** The text to show in the filter's panel */
  text: string,
 
  /** The value of the filter */
  value: any
}
 
/** TableColumn Component */
export declare class ElTableColumn extends ElementUIComponent {
  /** Type of the column. If set to `selection`, the column will display checkbox. If set to `index`, the column will display index of the row (staring from 1). If set to `expand`, the column will display expand icon. */
  type: TableColumnType
 
  /** Column label */
  label: string
 
  /** Column's key. If you need to use the filter-change event, you need this attribute to identify which column is being filtered */
  columnKey: string
 
  /** Field name. You can also use its alias: property */
  prop: string
 
  /** Column width */
  width: string
 
  /** Column minimum width. Columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion */
  minWidth: string
 
  /** Whether column is fixed at left/right. Will be fixed at left if `true` */
  fixed: boolean | TableColumnFixedType
 
  /** Render function for table header of this column */
  renderHeader: (h: CreateElement, data: RenderHeaderData) => VNode | string
 
  /** Whether column can be sorted */
  sortable: boolean | 'custom'
 
  /** Sorting method. Works when `sortable` is `true` */
  sortMethod: (a: any, b: any) => number
 
  /** The order of the sorting strategies used when sorting the data. Works when `sortable` is `true`. */
  sortOrders: SortOrders[]
 
  /** Whether column width can be resized. Works when border of `el-table` is `true` */
  resizable: boolean
 
  /** Function that formats content */
  formatter: (row: object, column: TableColumn) => any
 
  /** Whether to hide extra content and show them in a tooltip when hovering on the cell */
  showOverflowTooltip: boolean
 
  /** Alignment */
  align: ElementUIHorizontalAlignment
 
  /** Alignment of the table header. If omitted, the value of the `align` attribute will be applied */
  headerAlign: ElementUIHorizontalAlignment
 
  /** Class name of cells in the column */
  className: string
 
  /** Class name of the label of this column */
  labelClassName: string
 
  /** Function that determines if a certain row can be selected, works when `type` is `'selection'` */
  selectable: (row: object, index: number) => boolean
 
  /** Whether to reserve selection after data refreshing, works when `type` is `'selection'` */
  reserveSelection: boolean
 
  /** An array of data filtering options */
  filters: TableColumnFilter[]
 
  /** Placement for the filter dropdown */
  filterPlacement: PopoverPlacement
 
  /** Whether data filtering supports multiple options */
  filterMultiple: Boolean
 
  /** Data filtering method. If `filter-multiple` is on, this method will be called multiple times for each row, and a row will display if one of the calls returns `true` */
  filterMethod: (value: any, row: object) => boolean
 
  /** Filter value for selected data, might be useful when table header is rendered with `render-header` */
  filteredValue: TableColumnFilter[]
}