MCPcopy Index your code
hub / github.com/alibaba/lowcode-engine / import

Method import

packages/designer/src/document/node/node.ts:919–938  ·  view source on GitHub ↗
(data: Schema, checkId = false)

Source from the content-addressed store, hash-verified

917 }
918
919 import(data: Schema, checkId = false) {
920 const { componentName, id, children, props, ...extras } = data;
921 if (this.isSlot()) {
922 foreachReverse(
923 this.children!,
924 (subNode: INode) => {
925 subNode.remove(true, true);
926 },
927 (iterable, idx) => (iterable as INodeChildren).get(idx),
928 );
929 }
930 if (this.isParental()) {
931 this.props.import(props, extras);
932 this._children?.import(children, checkId);
933 } else {
934 this.props
935 .get('children', true)!
936 .setValue(isDOMText(children) || isJSExpression(children) ? children : '');
937 }
938 }
939
940 toData() {
941 return this.export();

Callers 1

schemaMethod · 0.95

Calls 9

isSlotMethod · 0.95
isParentalMethod · 0.95
foreachReverseFunction · 0.90
removeMethod · 0.65
getMethod · 0.65
importMethod · 0.65
setValueMethod · 0.65
isDOMTextFunction · 0.50
isJSExpressionFunction · 0.50

Tested by

no test coverage detected