From: Adam Dullage Date: Wed, 15 May 2024 11:43:59 +0000 (+0100) Subject: Save and load default edit type X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=3ecd6cb73b52f2227b3e024cb339e56b16d590cd;p=flatnotes.git Save and load default edit type --- diff --git a/client/components/toastui/ToastEditor.vue b/client/components/toastui/ToastEditor.vue index 49faaab..fe5e9df 100644 --- a/client/components/toastui/ToastEditor.vue +++ b/client/components/toastui/ToastEditor.vue @@ -10,6 +10,10 @@ import baseOptions from "./baseOptions.js"; const props = defineProps({ initialValue: String, + initialEditType: { + type: String, + default: "markdown", + }, }); const editorElement = ref(); @@ -20,6 +24,7 @@ onMounted(() => { ...baseOptions, el: editorElement.value, initialValue: props.initialValue, + initialEditType: props.initialEditType, }); }); @@ -27,7 +32,11 @@ function getMarkdown() { return toastEditor.getMarkdown(); } -defineExpose({ getMarkdown }); +function isWysiwygMode() { + return toastEditor.isWysiwygMode(); +} + +defineExpose({ getMarkdown, isWysiwygMode });