Skip to content

Commit

Permalink
Merge pull request #12 from Raerten/master
Browse files Browse the repository at this point in the history
add init event
  • Loading branch information
philippkuehn authored Sep 3, 2018
2 parents 64843dd + 6047263 commit beeafe2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/tiptap/src/components/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit beeafe2

Please sign in to comment.