From 4b70c6b3e709e4580e4b2444476f1608eaf53f6f Mon Sep 17 00:00:00 2001 From: Clark Cui <46164858+clark-cui@users.noreply.github.com> Date: Fri, 23 Dec 2022 22:08:10 +0800 Subject: [PATCH] fix: image edit dialog apply button (#527) --- components/publish/PublishAttachment.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/publish/PublishAttachment.vue b/components/publish/PublishAttachment.vue index 7365239c..c09dc72a 100644 --- a/components/publish/PublishAttachment.vue +++ b/components/publish/PublishAttachment.vue @@ -10,13 +10,17 @@ const props = withDefaults(defineProps<{ removable: true, }) -defineEmits<{ +const emit = defineEmits<{ (evt: 'remove'): void (evt: 'setDescription', description: string): void }>() const isEditDialogOpen = ref(false) const description = ref(props.attachment.description ?? '') +const toggleApply = () => { + isEditDialogOpen.value = false + emit('setDescription', unref(description)) +}