Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/02-example.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt-ssr-example/nuxt-ssr-example.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '<p><br></p>') 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
Expand Down
4 changes: 2 additions & 2 deletions src/ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '<p><br></p>') {
Expand All @@ -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
Expand Down