mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:52:51 +00:00
feat: add onMountNode event for DocumentModel
This commit is contained in:
parent
00c2d5ec51
commit
dcc247c7d5
@ -204,6 +204,16 @@ export default class DocumentModel {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前 document 新增节点事件,此时节点已经挂载到 document 上
|
||||
*/
|
||||
onMountNode(fn: (node: Node) => void) {
|
||||
this[editorSymbol].on('node.add', fn as any);
|
||||
return () => {
|
||||
this[editorSymbol].off('node.add', fn as any);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前 document 删除节点事件
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user