forked from Mirrors/elk
fix: image edit dialog apply button (#527)
This commit is contained in:
parent
0d4df4b269
commit
4b70c6b3e7
1 changed files with 6 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -52,7 +56,7 @@ const description = ref(props.attachment.description ?? '')
|
|||
</h1>
|
||||
<div flex flex-col gap-2>
|
||||
<textarea v-model="description" p-3 h-50 bg-base rounded-2 border-strong border-1 md:w-100 />
|
||||
<button btn-outline @click="$emit('setDescription', description)">
|
||||
<button btn-outline @click="toggleApply">
|
||||
{{ $t('action.apply') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue