mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
feat: 支持 node.children.onInsert
This commit is contained in:
parent
8ba26ee880
commit
f120df571b
@ -179,6 +179,7 @@ export class NodeChildren {
|
||||
}
|
||||
|
||||
this.emitter.emit('change');
|
||||
this.emitter.emit('insert', node);
|
||||
// this.reportModified(node, this.owner, { type: 'insert' });
|
||||
|
||||
// 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]() {
|
||||
// 保证向前兼容性
|
||||
return 'Array';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user