diff --git a/components/admin/AdminPostForm.vue b/components/admin/AdminPostForm.vue index fc14722..54410b2 100644 --- a/components/admin/AdminPostForm.vue +++ b/components/admin/AdminPostForm.vue @@ -14,7 +14,7 @@ const props = defineProps({ } }) -const emit = defineEmits(['submit']) +const emit = defineEmits(['submit', 'preview']) const autosaveStoragePrefix = 'SORI_ADMIN_POST_AUTOSAVE' const slugTouched = ref(Boolean(props.initialPost.slug)) @@ -414,6 +414,14 @@ const submitPost = () => { emit('submit', createPostPayload()) } +/** + * 게시물 미리보기 요청 + * @returns {void} + */ +const previewPost = () => { + emit('preview', createPostPayload()) +} + watch(form, scheduleAutosave, { deep: true }) onMounted(() => { @@ -669,6 +677,13 @@ defineExpose({ 취소 +