Skip to content
Snippets Groups Projects
Commit 85e09124 authored by Jörg Richter's avatar Jörg Richter
Browse files

Make Quill instance available as `quill` prop

parent 59a26f8d
No related branches found
No related tags found
No related merge requests found
Pipeline #5982 passed
......@@ -13,6 +13,12 @@ export default {
props: ['value', 'options'],
data () {
return {
quill: undefined // quill instance
}
},
created () {
// DM5 Webclient TODO: why is this component sometimes instantiated in detail panel "info" mode?
// console.log('quill created', init, this.$store.state.details.mode)
......@@ -24,13 +30,12 @@ export default {
mounted () {
// console.log('quill mounted')
const quill = new Quill(this.$refs.container, this.options)
quill.pasteHTML(this.value)
quill.on('text-change', () => {
const html = quill.root.innerHTML
this.$emit('input', html)
this.quill = new Quill(this.$refs.container, this.options)
this.quill.pasteHTML(this.value)
this.quill.on('text-change', () => {
this.$emit('input', this.quill.root.innerHTML)
})
this.$emit('quill-ready', quill)
this.$emit('quill-ready', this.quill)
}
}
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment