diff --git a/README.md b/README.md index 1ad9915be..d5f7b25bc 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,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. | +| `watchDoc` | `Boolean` | `true` | If set to `true` the content gets updated whenever `doc` changes. | | `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. | diff --git a/packages/tiptap/src/components/editor.js b/packages/tiptap/src/components/editor.js index da268c4cb..c8062ff93 100644 --- a/packages/tiptap/src/components/editor.js +++ b/packages/tiptap/src/components/editor.js @@ -32,6 +32,10 @@ export default { type: Boolean, default: true, }, + watchDoc: { + type: Boolean, + default: true, + }, }, data() { @@ -61,7 +65,9 @@ export default { doc: { deep: true, handler() { - this.setContent(this.doc, true) + if (this.watchDoc) { + this.setContent(this.doc, true) + } }, },