From: Adam Dullage Date: Fri, 3 May 2024 14:32:41 +0000 (+0100) Subject: Implement note save logic in note view X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=d237dd4a2f278150069b07117a93680597aa694c;p=flatnotes.git Implement note save logic in note view --- diff --git a/client/components/toastui/ToastEditor.vue b/client/components/toastui/ToastEditor.vue index 5b71e8c..056f5c1 100644 --- a/client/components/toastui/ToastEditor.vue +++ b/client/components/toastui/ToastEditor.vue @@ -12,15 +12,22 @@ const props = defineProps({ }); const editorElement = ref(); +let toastEditor; onMounted(() => { - new Editor({ + toastEditor = new Editor({ el: editorElement.value, height: "100%", initialValue: props.initialValue, plugins: [codeSyntaxHighlight], }); }); + +function getMarkdown() { + return toastEditor.getMarkdown(); +} + +defineExpose({ getMarkdown });