Skip to content

Commit

Permalink
fix(table): fix edit-table not work
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Jan 4, 2021
1 parent a2c89d2 commit c031163
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 0 additions & 6 deletions src/components/Table/src/components/editable/EditableCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,10 @@
});
watchEffect(() => {
console.log('======================');
console.log(1);
console.log('======================');
defaultValueRef.value = props.value;
});
watchEffect(() => {
console.log('======================');
console.log(2);
console.log('======================');
const { editable } = props.column;
if (isBoolean(editable) || isBoolean(unref(getRowEditable))) {
isEdit.value = !!editable || unref(getRowEditable);
Expand Down
7 changes: 4 additions & 3 deletions src/components/Table/src/hooks/useColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,16 @@ export function useColumns(
}
const { ellipsis } = unref(propsRef);

columns.forEach((item) => {
const cloneColumns = cloneDeep(columns);
cloneColumns.forEach((item) => {
const { customRender, slots } = item;

handleItem(
item,
Reflect.has(item, 'ellipsis') ? !!item.ellipsis : !!ellipsis && !customRender && !slots
);
});
return columns;
return cloneColumns;
});

const getViewColumns = computed(() => {
Expand All @@ -152,7 +153,7 @@ export function useColumns(
column.customRender = renderEditCell(column);
}
});
return viewColumns;
return columns;
});

watch(
Expand Down

0 comments on commit c031163

Please sign in to comment.