add init event
This commit is contained in:
@@ -59,6 +59,7 @@ export default {
|
|||||||
| `editable` | `Boolean` | `true` | When set to `false` the editor is read-only. |
|
| `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. |
|
| `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`. |
|
| `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. |
|
| `@update` | `Object` | `undefined` | This will return an Object with the current `state` of Prosemirror, a `getJSON()` and `getHTML()` function on every change. |
|
||||||
|
|
||||||
## Scoped Slots
|
## Scoped Slots
|
||||||
|
|||||||
@@ -100,6 +100,10 @@ export default {
|
|||||||
this.view = this.createView()
|
this.view = this.createView()
|
||||||
this.commands = this.createCommands()
|
this.commands = this.createCommands()
|
||||||
this.updateMenuActions()
|
this.updateMenuActions()
|
||||||
|
this.$emit('init', {
|
||||||
|
view: this.view,
|
||||||
|
state: this.state,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
createSchema() {
|
createSchema() {
|
||||||
|
|||||||
Reference in New Issue
Block a user