Commit 8d22231a5fa4afed19201a4a4e5c29d674498516
1 parent
8eba7fb5
fix(table): event editCancel loss params
修复table的editCancel事件缺少部分参数的问题
Showing
1 changed file
with
8 additions
and
1 deletions
src/components/Table/src/components/editable/EditableCell.vue
... | ... | @@ -249,7 +249,14 @@ |
249 | 249 | function handleCancel() { |
250 | 250 | isEdit.value = false; |
251 | 251 | currentValueRef.value = defaultValueRef.value; |
252 | - table.emit?.('edit-cancel', unref(currentValueRef)); | |
252 | + const { column, index, record } = props; | |
253 | + const { key, dataIndex } = column; | |
254 | + table.emit?.('edit-cancel', { | |
255 | + record, | |
256 | + index, | |
257 | + key: dataIndex || key, | |
258 | + value: unref(currentValueRef), | |
259 | + }); | |
253 | 260 | } |
254 | 261 | |
255 | 262 | function onClickOutside() { | ... | ... |