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