GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add onMountNode event for DocumentModel · ikvm/lowcode-engine@dcc247c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/shell/src
    • document-model.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/shell/src/document-model.ts‎

Copy file name to clipboardExpand all lines: packages/shell/src/document-model.ts
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,16 @@ export default class DocumentModel {
204204
});
205205
}
206206

207+
/**
208+
* 当前 document 新增节点事件,此时节点已经挂载到 document 上
209+
*/
210+
onMountNode(fn: (node: Node) => void) {
211+
this[editorSymbol].on('node.add', fn as any);
212+
return () => {
213+
this[editorSymbol].off('node.add', fn as any);
214+
};
215+
}
216+
207217
/**
208218
* 当前 document 删除节点事件
209219
*/

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.