@@ -1354,6 +1354,94 @@ Customize table column so it can be integrated with other components.
...
@@ -1354,6 +1354,94 @@ Customize table column so it can be integrated with other components.
```
```
:::
:::
### Expandable row
When the row content is too long and you do not want to display the horizontal scroll bar, you can use the expandable row feature.
:::demo Activate expandable row by adding type="expand" and `inline-template` attribute,The template for `el-table-column` will be rendered as the contents of the expanded row, you can access the same attributes as the` inline-template`。
@@ -1369,7 +1457,9 @@ Customize table column so it can be integrated with other components.
...
@@ -1369,7 +1457,9 @@ Customize table column so it can be integrated with other components.
| row-style | function that returns custom style for a row, or a string assigning custom style for every row | Function(row, index)/Object | — | — |
| row-style | function that returns custom style for a row, or a string assigning custom style for every row | Function(row, index)/Object | — | — |
| row-key | key of row data, used for optimizing rendering. Required if `reserve-selection` is on | Function(row)/String | — | — |
| row-key | key of row data, used for optimizing rendering. Required if `reserve-selection` is on | Function(row)/String | — | — |
| context | context of Table, e.g. `_self` refers to the current context, `$parent` parent context, `$root` root context, can be overridden by `context` in `el-table-column` | Object | - | current context where Table lies |
| context | context of Table, e.g. `_self` refers to the current context, `$parent` parent context, `$root` root context, can be overridden by `context` in `el-table-column` | Object | - | current context where Table lies |
| empty-text | Displayed text when data is empty. You can customize this area with `slot="empty"` | String | | - | No Data |
| empty-text | Displayed text when data is empty. You can customize this area with `slot="empty"` | String | - | No Data |
| default-expand-all | whether expand all rows by default, only works when the table has a column type="expand" | Boolean | - | false |
| expand-row-keys | set expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop | Array | - | |
### Table Events
### Table Events
| Event Name | Description | Parameters |
| Event Name | Description | Parameters |
...
@@ -1387,6 +1477,7 @@ Customize table column so it can be integrated with other components.
...
@@ -1387,6 +1477,7 @@ Customize table column so it can be integrated with other components.
| sort-change | triggers when Table's sorting changes | { column, prop, order } |
| sort-change | triggers when Table's sorting changes | { column, prop, order } |
| filter-change | column's key. If you need to use the filter-change event, this attribute is mandatory to identify which column is being filtered | filters |
| filter-change | column's key. If you need to use the filter-change event, this attribute is mandatory to identify which column is being filtered | filters |
| current-change | triggers when current row changes | currentRow, oldCurrentRow |
| current-change | triggers when current row changes | currentRow, oldCurrentRow |
| expand | triggers when user expands or collapses a row | row, expanded |
### Table Methods
### Table Methods
| Method | Description | Parameter |
| Method | Description | Parameter |
...
@@ -1397,7 +1488,7 @@ Customize table column so it can be integrated with other components.
...
@@ -1397,7 +1488,7 @@ Customize table column so it can be integrated with other components.
| type | 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) | string | selection/index | — |
| type | 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. | string | selection/index/expand | — |
| label | column label | string | — | — |
| label | column label | string | — | — |
| column-key | column's key. If you need to use the filter-change event, you need this attribute to identify which column is being filtered | string | string | - | - |
| column-key | column's key. If you need to use the filter-change event, you need this attribute to identify which column is being filtered | string | string | - | - |
| prop | field name. You can also use its alias: `property` | string | — | — |
| prop | field name. You can also use its alias: `property` | string | — | — |