EditCell
EditCell is an inline editable cell component used by editable table scenarios. It supports multiple editor types, validation, tooltip display, popover editing, and batch-paste integration.
Basic Usage
Basic editable cell with the default input editor.
Showtips
Set showtips to show the full value in a tooltip when the display text is truncated.
Different Editors
Use element to switch between supported editor types such as el-input, el-input-number, and el-select.
Popover Edit
Set popoverEdit to edit the value inside a popover textarea.
Behavior Notes
- When
always-editisfalse, the cell enters edit mode after click. - When
elementis set totext, the component renders display text only. - When
need-batch-copyistrue, paste is intercepted and emitted through thepasteevent. - When
EditCellis rendered insideBaseTable, it automatically participates invalidateCells()andclearCellValidate().
API
EditCell Attributes
| Name | Description | Type | Default |
|---|---|---|---|
| value / v-model:value | cell value | string / number / array | '' |
| prop | validation field path | string / array | — |
| rules | validation rules passed to async-validator | array / object | — |
| required | explicitly control the required state used by validation | boolean | false |
| item-props | extra props forwarded to the inner editor component | object | {} |
| element | editor type | string | 'el-input' |
| always-edit | always show the editor instead of click-to-edit mode | boolean | false |
| disabled | disable editing | boolean | false |
| clearable | whether the editor can be cleared | boolean | true |
| filterable | enable filtering for select-like editors | boolean | false |
| placeholder | placeholder text | string | '' |
| maxlength | max input length | string / number | 256 |
| size | component size | string | 'default' |
| min | minimum value for number editors | number | 0 |
| max | maximum value for number editors | number | 9999 |
| step | step for number editors | number | 1 |
| precision | precision for number editors | number | 0 |
| readonly | read-only mode | boolean | false |
| showtips | show tooltip for display text | boolean | false |
| popover-edit | edit the value in a popover textarea | boolean | false |
| popover-props | extra props forwarded to the popover textarea | object | {} |
| row | current row data context | object | {} |
| need-batch-copy | enable batch paste handling | boolean | false |
Validation priority: when
requiredis explicitly passed toEditCell, it overridesrules.required. Ifrequiredis not passed, the component uses therequiredvalue defined inrules.
Validation Behavior
- Validation is handled by
async-validator. - Rules are filtered by trigger. If a rule has no
trigger, it participates in any validation call. - String values are trimmed before
changeandblurvalidation completes.
EditCell Events
| Name | Description | Type |
|---|---|---|
| update:value | triggered when the value changes | Function |
| change | triggered after value change handling completes | Function |
| focus | triggered when the editor gains focus | Function |
| blur | triggered when editing ends | Function |
| paste | triggered on paste when need-batch-copy is enabled | Function |
Exposes
| Name | Description | Type |
|---|---|---|
| validate | validate the current cell with the given trigger | Function |
| clearValidate | clear the current validation state | Function |
| validateState | current validation state | string |
| validateMessage | current validation message | string |