Ver código fonte

fix: 修复EditCellTable 可编辑单元格当columns.ellipsis=true时,回调中取不到key的值。 (#1598)

wentmac 3 anos atrás
pai
commit
e82bafa43e

+ 2 - 2
src/components/Table/src/components/editable/EditableCell.vue

@@ -265,7 +265,7 @@
               result = await beforeEditSubmit({
                 record: pick(record, keys),
                 index,
-                key: key as string,
+                key: dataKey as string,
                 value,
               });
             } catch (e) {
@@ -281,7 +281,7 @@
 
         set(record, dataKey, value);
         //const record = await table.updateTableData(index, dataKey, value);
-        needEmit && table.emit?.('edit-end', { record, index, key, value });
+        needEmit && table.emit?.('edit-end', { record, index, key: dataKey, value });
         isEdit.value = false;
       }