Skip to content

Commit

Permalink
fix(table): treeTable editable error
Browse files Browse the repository at this point in the history
修复树表格的编辑问题

fixed: #811
  • Loading branch information
mynetfan committed Jun 25, 2021
1 parent fa64fc8 commit 4ae39c5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Table/src/components/editable/EditableCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import { propTypes } from '/@/utils/propTypes';
import { isString, isBoolean, isFunction, isNumber, isArray } from '/@/utils/is';
import { createPlaceholderMessage } from './helper';
import { set } from 'lodash-es';
export default defineComponent({
name: 'EditableCell',
Expand Down Expand Up @@ -227,14 +228,16 @@
if (!isPass) return false;
}
const { column, index } = props;
const { column, index, record } = props;
if (!record) return false;
const { key, dataIndex } = column;
const value = unref(currentValueRef);
if (!key || !dataIndex) return;
const dataKey = (dataIndex || key) as string;
const record = await table.updateTableData(index, dataKey, value);
set(record, dataKey, value);
//const record = await table.updateTableData(index, dataKey, value);
needEmit && table.emit?.('edit-end', { record, index, key, value });
isEdit.value = false;
}
Expand Down

0 comments on commit 4ae39c5

Please sign in to comment.