Commit 1a85dff57d934be2f0d4bb1056ca3412cb946fa6

Authored by 葡萄架
Committed by GitHub
1 parent 61cf0f79

Fix the return value when editing the cell(#219)

修正单元格编辑提交时的返回值 .这个地方应该返回真实值,而不是editValueMap处理后的值或Select插槽的option.label。
src/components/Table/src/components/editable/EditableCell.vue
@@ -227,12 +227,12 @@ @@ -227,12 +227,12 @@
227 if (!isPass) return false; 227 if (!isPass) return false;
228 const { column, index } = props; 228 const { column, index } = props;
229 const { key, dataIndex } = column; 229 const { key, dataIndex } = column;
230 - // const value = unref(currentValueRef); 230 + const value = unref(currentValueRef);
231 if (!key || !dataIndex) return; 231 if (!key || !dataIndex) return;
232 const dataKey = (dataIndex || key) as string; 232 const dataKey = (dataIndex || key) as string;
233 233
234 - const record = await table.updateTableData(index, dataKey, unref(getValues));  
235 - needEmit && table.emit?.('edit-end', { record, index, key, value: unref(currentValueRef) }); 234 + const record = await table.updateTableData(index, dataKey, value);
  235 + needEmit && table.emit?.('edit-end', { record, index, key, value});
236 isEdit.value = false; 236 isEdit.value = false;
237 } 237 }
238 238