From b8e87256d1b7eabeb6da016fd8e1cc80e6b723ba Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Mon, 28 Feb 2022 11:04:52 +0100 Subject: [PATCH] Fix value bug --- client/src/components/content-forms/TipTap.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/src/components/content-forms/TipTap.vue b/client/src/components/content-forms/TipTap.vue index d03402e1..a0a15ac4 100644 --- a/client/src/components/content-forms/TipTap.vue +++ b/client/src/components/content-forms/TipTap.vue @@ -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:(this.editor).getHTML() - }; - this.$emit('input', newValue); + const text=(this.editor).getHTML(); + this.$emit('input', text); + this.$emit('change-text', text); } }); },