Fix value bug

This commit is contained in:
Ramon Wenger 2022-02-28 11:04:52 +01:00
parent 233a2655f7
commit b8e87256d1
1 changed files with 7 additions and 6 deletions

View File

@ -52,6 +52,9 @@
computed: { computed: {
isList(): boolean { isList(): boolean {
return this.editor?.isActive('bulletList') || false; return this.editor?.isActive('bulletList') || false;
},
text(): string {
return this.value.text;
} }
}, },
@ -69,14 +72,13 @@
}, },
mounted() { mounted() {
console.log('mounted tip tap');
this.editor = new Editor({ this.editor = new Editor({
editorProps: { editorProps: {
attributes: { attributes: {
class: 'tip-tap__editor' class: 'tip-tap__editor'
} }
}, },
content: this.value, content: this.text,
extensions: [ extensions: [
Document, Document,
Paragraph, Paragraph,
@ -85,10 +87,9 @@
ListItem ListItem
], ],
onUpdate: () => { onUpdate: () => {
const newValue = { const text=(<Editor>this.editor).getHTML();
text:(<Editor>this.editor).getHTML() this.$emit('input', text);
}; this.$emit('change-text', text);
this.$emit('input', newValue);
} }
}); });
}, },