diff --git a/README.md b/README.md index fa93596d..ee50840b 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ export default { | `editable` | `Boolean` | `true` | When set to `false` the editor is read-only. | | `doc` | `Object` | `null` | The editor state object used by Prosemirror. You can also pass HTML to the `content` slot. When used both, the `content` slot will be ignored. | | `extensions` | `Array` | `[]` | A list of extensions used, by the editor. This can be `Nodes`, `Marks` or `Plugins`. | +| `@init` | `Object` | `undefined` | This will return an Object with the current `state` and `view` of Prosemirror on init. | | `@update` | `Object` | `undefined` | This will return an Object with the current `state` of Prosemirror, a `getJSON()` and `getHTML()` function on every change. | ## Scoped Slots diff --git a/packages/tiptap/src/components/editor.js b/packages/tiptap/src/components/editor.js index 7ffd9f82..461aa0ba 100644 --- a/packages/tiptap/src/components/editor.js +++ b/packages/tiptap/src/components/editor.js @@ -100,6 +100,10 @@ export default { this.view = this.createView() this.commands = this.createCommands() this.updateMenuActions() + this.$emit('init', { + view: this.view, + state: this.state, + }) }, createSchema() {