mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-20 07:14:23 +00:00
fix: 🐛 get deps info from slot
This commit is contained in:
parent
23bc6214d6
commit
6c3ae36bca
@ -8,12 +8,14 @@ import {
|
|||||||
CodePiece,
|
CodePiece,
|
||||||
HandlerSet,
|
HandlerSet,
|
||||||
ExtGeneratorPlugin,
|
ExtGeneratorPlugin,
|
||||||
|
IJSSlot,
|
||||||
INodeGeneratorConfig,
|
INodeGeneratorConfig,
|
||||||
INodeGeneratorContext,
|
INodeGeneratorContext,
|
||||||
NodeGenerator,
|
NodeGenerator,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
import { generateCompositeType } from './compositeType';
|
import { generateCompositeType } from './compositeType';
|
||||||
import { generateExpression, isJsExpression } from './jsExpression';
|
import { generateExpression, isJsExpression } from './jsExpression';
|
||||||
|
import { isJsSlot } from './jsSlot';
|
||||||
|
|
||||||
// tslint:disable-next-line: no-empty
|
// tslint:disable-next-line: no-empty
|
||||||
const noop = () => [];
|
const noop = () => [];
|
||||||
@ -50,6 +52,17 @@ export function handleSubNodes<T>(
|
|||||||
const childRes = handleSubNodes(children.children, handlers, opt);
|
const childRes = handleSubNodes(children.children, handlers, opt);
|
||||||
curRes = curRes.concat(childRes || []);
|
curRes = curRes.concat(childRes || []);
|
||||||
}
|
}
|
||||||
|
if (children.props) {
|
||||||
|
Object.keys(children.props)
|
||||||
|
.filter((propName) => isJsSlot(children.props[propName]))
|
||||||
|
.forEach((propName) => {
|
||||||
|
const soltVals = (children.props[propName] as IJSSlot).value;
|
||||||
|
(soltVals || []).forEach((soltVal) => {
|
||||||
|
const childRes = handleSubNodes(soltVal, handlers, opt);
|
||||||
|
curRes = curRes.concat(childRes || []);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
return curRes;
|
return curRes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user