refactor: modify parameter types of onMountNode

This commit is contained in:
LeoYuan 袁力皓 2022-09-08 16:53:53 +08:00 committed by 刘菊萍(絮黎)
parent dbe0764ff4
commit 391251788a

View File

@ -207,7 +207,7 @@ export default class DocumentModel {
/**
* document document
*/
onMountNode(fn: (node: Node) => void) {
onMountNode(fn: (payload: { node: Node }) => void) {
this[editorSymbol].on('node.add', fn as any);
return () => {
this[editorSymbol].off('node.add', fn as any);