Fix value bug
This commit is contained in:
parent
233a2655f7
commit
b8e87256d1
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue