fix: image edit dialog apply button (#527)
parent
0d4df4b269
commit
4b70c6b3e7
|
@ -10,13 +10,17 @@ const props = withDefaults(defineProps<{
|
||||||
removable: true,
|
removable: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
defineEmits<{
|
const emit = defineEmits<{
|
||||||
(evt: 'remove'): void
|
(evt: 'remove'): void
|
||||||
(evt: 'setDescription', description: string): void
|
(evt: 'setDescription', description: string): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const isEditDialogOpen = ref(false)
|
const isEditDialogOpen = ref(false)
|
||||||
const description = ref(props.attachment.description ?? '')
|
const description = ref(props.attachment.description ?? '')
|
||||||
|
const toggleApply = () => {
|
||||||
|
isEditDialogOpen.value = false
|
||||||
|
emit('setDescription', unref(description))
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -52,7 +56,7 @@ const description = ref(props.attachment.description ?? '')
|
||||||
</h1>
|
</h1>
|
||||||
<div flex flex-col gap-2>
|
<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 />
|
<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') }}
|
{{ $t('action.apply') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue