mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
Merge branch 'fix/checkId-node' into 'release/1.0.0'
fix: checkId 需要传递 See merge request !1007574
This commit is contained in:
commit
571883e6ed
@ -222,7 +222,7 @@ export class DocumentModel {
|
||||
}
|
||||
}
|
||||
if (!node) {
|
||||
node = new Node(this, schema);
|
||||
node = new Node(this, schema, { checkId });
|
||||
// will add
|
||||
// todo: this.activeNodes?.push(node);
|
||||
}
|
||||
|
||||
@ -11,9 +11,9 @@ export class NodeChildren {
|
||||
|
||||
private emitter = new EventEmitter();
|
||||
|
||||
constructor(readonly owner: ParentalNode, data: NodeData | NodeData[]) {
|
||||
constructor(readonly owner: ParentalNode, data: NodeData | NodeData[], options: any = {}) {
|
||||
this.children = (Array.isArray(data) ? data : [data]).map(child => {
|
||||
return this.owner.document.createNode(child);
|
||||
return this.owner.document.createNode(child, options.checkId);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
|
||||
readonly settingEntry: SettingTopEntry;
|
||||
|
||||
constructor(readonly document: DocumentModel, nodeSchema: Schema) {
|
||||
constructor(readonly document: DocumentModel, nodeSchema: Schema, options: any = {}) {
|
||||
const { componentName, id, children, props, ...extras } = nodeSchema;
|
||||
this.id = id || document.nextId();
|
||||
this.componentName = componentName;
|
||||
@ -167,7 +167,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
// import 是为了使用钩子返回的值,并非完全幂等的操作,部分行为执行两次会有 bug,
|
||||
// 所以在 props 里会对 new / import 做一些区别化的解析
|
||||
this.props = new Props(this, props, extras);
|
||||
this._children = new NodeChildren(this as ParentalNode, this.initialChildren(children));
|
||||
this._children = new NodeChildren(this as ParentalNode, this.initialChildren(children), options);
|
||||
this._children.internalInitParent();
|
||||
this.props.import(this.upgradeProps(this.initProps(props || {})), this.upgradeProps(extras || {}));
|
||||
this.setupAutoruns();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user