diff --git a/examples/02-example.vue b/examples/02-example.vue index 4b704f9..e1ac540 100644 --- a/examples/02-example.vue +++ b/examples/02-example.vue @@ -74,8 +74,8 @@ } }, methods: { - onEditorChange({ editor, html, text }) { - // console.log('editor change!', editor, html, text) + onEditorChange({ editor, html, text, quillEvent }) { + // console.log('editor change!', editor, html, text, quillEvent) this.content = html } }, diff --git a/examples/nuxt-ssr-example/nuxt-ssr-example.vue b/examples/nuxt-ssr-example/nuxt-ssr-example.vue index 2f2b6ac..a660101 100644 --- a/examples/nuxt-ssr-example/nuxt-ssr-example.vue +++ b/examples/nuxt-ssr-example/nuxt-ssr-example.vue @@ -43,8 +43,8 @@ onEditorReady(editor) { console.log('editor ready!', editor) }, - onEditorChange({ editor, html, text }) { - console.log('editor change!', editor, html, text) + onEditorChange({ editor, html, text, quillEvent }) { + console.log('editor change!', editor, html, text, quillEvent) this.content = html } } diff --git a/src/editor.vue b/src/editor.vue index 46f7763..5888d7c 100644 --- a/src/editor.vue +++ b/src/editor.vue @@ -104,14 +104,14 @@ }) // Update model if text changes - this.quill.on('text-change', (delta, oldDelta, source) => { + this.quill.on('text-change', (delta, oldContents, source) => { let html = this.$refs.editor.children[0].innerHTML const quill = this.quill const text = this.quill.getText() if (html === '


') html = '' this._content = html this.$emit('input', this._content) - this.$emit('change', { html, text, quill }) + this.$emit('change', { html, text, quill, quillEvent: { delta, oldContents, source } }) }) // Emit ready event diff --git a/src/ssr.js b/src/ssr.js index a682204..4a6741b 100644 --- a/src/ssr.js +++ b/src/ssr.js @@ -97,7 +97,7 @@ const quillDirective = globalOptions => { }) // Update model if text changes - quill.on('text-change', (delta, oldDelta, source) => { + quill.on('text-change', (delta, oldContents, source) => { let html = el.children[0].innerHTML const text = quill.getText() if (html === '


') { @@ -108,7 +108,7 @@ const quillDirective = globalOptions => { model.callback(html) } eventEmit(vnode, 'input', html) - eventEmit(vnode, 'change', { text, html, quill }) + eventEmit(vnode, 'change', { text, html, quill, quillEvent: { delta, oldContents, source } }) }) // Emit ready event