Skip to content

Commit

Permalink
perf: 增加重置后清空排序设置演示
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Sep 12, 2023
1 parent 3953dee commit 6a563ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/fast-crud/src/use/use-columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,19 @@ function buildColumns(userOptions: CrudOptions) {
return userOptions;
}

export function forEachTableColumns(columns: TableColumnsProps, callback: (col: ColumnProps, key: string) => void) {
_.forEach(columns, (item, key) => {
if (!item.key) {
item.key = key;
}
if (item.children) {
forEachTableColumns(item.children, callback);
} else {
callback(item, key);
}
});
}

export function forEachColumns(
columns: CompositionColumns,
callback: (col: ColumnCompositionProps, key: string) => void
Expand Down

0 comments on commit 6a563ad

Please sign in to comment.