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