Latestv1.0.60
Table - Column Configuration
Dynamically control column visibility and fixed direction through the column configuration panel for personalized table display.
Column Visibility Control
Control each column's show/hide through checkboxes in the panel, supporting select all / deselect all operations.
Column Visibility Control
Fixed Column Config
Dynamically set whether each column is fixed to the left or right through the config panel. Click an already selected direction to unfix.
Fixed Column Config
Full Column Config Panel
Combines visibility control and fixed column config, with a reset button to restore default settings.
Full Column Config Panel
API
ColumnItem Configuration
| Property | Description | Type | Default |
|---|---|---|---|
| prop | Column field name | string | — |
| label | Column title | string | — |
| width | Column width | number | — |
| visible | Whether to show | boolean | true |
| fixed | Fixed direction | 'left' | 'right' | false | false |
Implementation Details
- Column Visibility: Maintain a column config array with
visibleproperty, usecomputedto filtervisible: truecolumns for the table - Column Fixing: Set the
fixedproperty in column config, mapped to the table column'sfixedproperty - Reactivity: Config changes automatically trigger table re-rendering, no manual refresh needed
Usage Tips
- Column config data can be stored in
localStoragefor persistence - It's recommended to provide a "Reset" function for users to restore default settings
- When configuring fixed columns, ensure the total width of left and right fixed columns doesn't exceed the table width
- Combined with column drag feature for more flexible column order adjustment