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', () => {