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

Method setSchema

packages/designer/src/project/project.ts:196–201  ·  view source on GitHub ↗

* 替换当前 document 的 schema,并触发渲染器的 render * @param schema

(schema?: IPublicTypeProjectSchema)

Source from the content-addressed store, hash-verified

194 * @param schema
195 */
196 setSchema(schema?: IPublicTypeProjectSchema) {
197 // FIXME: 这里的行为和 getSchema 并不对等,感觉不太对
198 const doc = this.documents.find((doc) => doc.active);
199 doc && schema?.componentsTree[0] && doc.import(schema?.componentsTree[0]);
200 this.simulator?.rerender();
201 }
202
203 /**
204 * 整体设置项目 schema

Callers 3

project.test.tsFile · 0.45
designer.test.tsFile · 0.45

Calls 3

findMethod · 0.65
importMethod · 0.65
rerenderMethod · 0.65

Tested by

no test coverage detected