Skip to content

Commit

Permalink
fix: 行编辑支持多级表头
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Mar 4, 2023
1 parent d5cc254 commit a547c99
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion packages/fast-crud/src/components/crud/editable/use-editable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,18 @@ export function useEditable(props: any, ctx: any, tableRef: any) {
return cell;
}

function eachTree(tree: any, callback: any) {
_.forEach(tree, (item) => {
if (item.children) {
eachTree(item.children, callback);
} else {
callback(item);
}
});
}
function createEditableRow(index: number, rowData: any) {
const cells: any = {};
_.forEach(props.columns, (item) => {
eachTree(props.columns, (item: any) => {
const config = item.editable ?? {};
let disabled = config.disabled ?? false;
if (disabled instanceof Function) {
Expand Down

0 comments on commit a547c99

Please sign in to comment.