add init event
This commit is contained in:
@@ -28,6 +28,7 @@ export default class Editor {
|
|||||||
editable: true,
|
editable: true,
|
||||||
extensions: [],
|
extensions: [],
|
||||||
content: '',
|
content: '',
|
||||||
|
onInit: () => {},
|
||||||
onUpdate: () => {},
|
onUpdate: () => {},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +52,10 @@ export default class Editor {
|
|||||||
this.view = this.createView()
|
this.view = this.createView()
|
||||||
this.commands = this.createCommands()
|
this.commands = this.createCommands()
|
||||||
this.getActiveNodesAndMarks()
|
this.getActiveNodesAndMarks()
|
||||||
this.emit('init')
|
this.options.onInit({
|
||||||
|
view: this.view,
|
||||||
|
state: this.state,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
createExtensions() {
|
createExtensions() {
|
||||||
|
|||||||
Reference in New Issue
Block a user