From ee0b34dad09dad872e5a62fb70850fbcd7152872 Mon Sep 17 00:00:00 2001 From: khj0414 Date: Mon, 17 Feb 2025 14:56:01 +0900 Subject: [PATCH] =?UTF-8?q?qeditor=EC=88=98=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/editor/QEditor.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/editor/QEditor.vue b/src/components/editor/QEditor.vue index 84fee83..3ff77e9 100644 --- a/src/components/editor/QEditor.vue +++ b/src/components/editor/QEditor.vue @@ -46,7 +46,6 @@
-
내용을 확인해주세요.
@@ -64,6 +63,10 @@ const props = defineProps({ type: Boolean, default: false, }, + initialData: { + type: String, + default: () => null, + }, }); const editor = ref(null); // 에디터 DOM 참조 @@ -108,8 +111,14 @@ onMounted(() => { watch([font, fontSize], () => { quillInstance.format('font', font.value); quillInstance.format('size', fontSize.value); + }); + // 초기 데이터가 있을 경우, HTML 형식으로 삽입 + if (props.initialData) { + quillInstance.setContents(JSON.parse(props.initialData)); + } + // 이미지 업로드 기능 처리 let imageUrls = new Set(); // 업로드된 이미지 URL을 추적 quillInstance.getModule('toolbar').addHandler('image', () => {