mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-04 17:27:09 +00:00
Merge branch 'feat/node-onInsert' into 'release/0.9.22'
feat: 支持 node.children.onInsert See merge request !989981
This commit is contained in:
commit
36a4eefa6a
@ -179,6 +179,7 @@ export class NodeChildren {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.emitter.emit('change');
|
this.emitter.emit('change');
|
||||||
|
this.emitter.emit('insert', node);
|
||||||
// this.reportModified(node, this.owner, { type: 'insert' });
|
// this.reportModified(node, this.owner, { type: 'insert' });
|
||||||
|
|
||||||
// check condition group
|
// check condition group
|
||||||
@ -330,6 +331,13 @@ export class NodeChildren {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onInsert(fn: (node: Node) => void) {
|
||||||
|
this.emitter.on('insert', fn);
|
||||||
|
return () => {
|
||||||
|
this.emitter.removeListener('insert', fn);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
get [Symbol.toStringTag]() {
|
get [Symbol.toStringTag]() {
|
||||||
// 保证向前兼容性
|
// 保证向前兼容性
|
||||||
return 'Array';
|
return 'Array';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user