fix(table): fix edit-table not work

This commit is contained in:
vben
2021-01-04 23:36:20 +08:00
parent a2c89d2e84
commit c031163f34
2 changed files with 4 additions and 9 deletions

View File

@@ -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);

View File

@@ -117,7 +117,8 @@ export function useColumns(
}
const { ellipsis } = unref(propsRef);
columns.forEach((item) => {
const cloneColumns = cloneDeep(columns);
cloneColumns.forEach((item) => {
const { customRender, slots } = item;
handleItem(
@@ -125,7 +126,7 @@ export function useColumns(
Reflect.has(item, 'ellipsis') ? !!item.ellipsis : !!ellipsis && !customRender && !slots
);
});
return columns;
return cloneColumns;
});
const getViewColumns = computed(() => {
@@ -152,7 +153,7 @@ export function useColumns(
column.customRender = renderEditCell(column);
}
});
return viewColumns;
return columns;
});
watch(