Skip to content

Commit

Permalink
fix(table): columns ref fixed(#564) (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetfan committed May 7, 2021
1 parent 9cd293c commit 43e4c21
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/Table/src/hooks/useColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function useColumns(
let cacheColumns = unref(propsRef).columns;

const getColumnsRef = computed(() => {
const columns = unref(columnsRef);
const columns = cloneDeep(unref(columnsRef));

handleIndexColumn(propsRef, getPaginationRef, columns);
handleActionColumn(propsRef, columns);
Expand All @@ -122,16 +122,15 @@ export function useColumns(
}
const { ellipsis } = unref(propsRef);

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

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

function isIfShow(column: BasicColumn): boolean {
Expand Down

0 comments on commit 43e4c21

Please sign in to comment.