get value updates from outside in editor
This commit is contained in:
@@ -67,12 +67,25 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
linkActive: false,
|
linkActive: false,
|
||||||
editor: null
|
editor: null,
|
||||||
|
update: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value () {
|
||||||
|
if (this.update) {
|
||||||
|
this.update = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.editor.setContent(this.value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.editor = new Editor({
|
this.editor = new Editor({
|
||||||
onUpdate: _.debounce(({ getHTML }) => this.$emit('input', getHTML()), 300),
|
onUpdate: _.debounce(({ getHTML }) => {
|
||||||
|
this.update = true
|
||||||
|
this.$emit('input', getHTML())
|
||||||
|
}, 300),
|
||||||
content: this.value,
|
content: this.value,
|
||||||
extensions: [
|
extensions: [
|
||||||
new Blockquote(),
|
new Blockquote(),
|
||||||
|
|||||||
Reference in New Issue
Block a user