mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
Merge branch 'fix/checkId' into 'release/1.0.0'
fix: 支持 checkId 开关功能, 在 setSchema 时关闭, 避免 id 被不断重置 See merge request !988464
This commit is contained in:
commit
4f89c98408
@ -193,7 +193,7 @@ export class DocumentModel {
|
||||
/**
|
||||
* 根据 schema 创建一个节点
|
||||
*/
|
||||
createNode<T extends Node = Node, C = undefined>(data: GetDataType<C, T>): T {
|
||||
createNode<T extends Node = Node, C = undefined>(data: GetDataType<C, T>, checkId: boolean = true): T {
|
||||
let schema: any;
|
||||
if (isDOMText(data) || isJSExpression(data)) {
|
||||
schema = {
|
||||
@ -205,7 +205,7 @@ export class DocumentModel {
|
||||
}
|
||||
|
||||
let node: Node | null = null;
|
||||
if (this.inited) {
|
||||
if (this.inited && checkId) {
|
||||
schema.id = null;
|
||||
}
|
||||
if (schema.id) {
|
||||
|
||||
@ -51,7 +51,7 @@ export class NodeChildren {
|
||||
node = child;
|
||||
node.import(item);
|
||||
} else {
|
||||
node = this.owner.document.createNode(item);
|
||||
node = this.owner.document.createNode(item, checkId);
|
||||
}
|
||||
children[i] = node;
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ export class Project {
|
||||
*/
|
||||
setSchema(schema?: ProjectSchema) {
|
||||
const doc = this.documents.find((doc) => doc.actived);
|
||||
doc && doc.import(schema?.componentsTree[0]);
|
||||
doc && doc.import(schema?.componentsTree[0], false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user