chore(AlertDialog): supper appear and close

This commit is contained in:
Benjamin Canac
2022-03-11 16:22:03 +01:00
parent c71fc69b4b
commit e8a1b46598

View File

@@ -1,5 +1,5 @@
<template>
<Modal v-model="isOpen" class="w-full">
<Modal v-model="isOpen" :appear="appear" class="w-full" @close="onClose">
<div class="sm:flex sm:items-start">
<div v-if="icon" :class="iconWrapperClass" class="mx-auto flex-shrink-0 flex items-center justify-center rounded-full sm:mx-0">
<Icon :name="icon" :class="iconClass" />
@@ -33,6 +33,10 @@ const props = defineProps({
type: Boolean,
default: false
},
appear: {
type: Boolean,
default: false
},
icon: {
type: String,
default: ''
@@ -75,7 +79,7 @@ const props = defineProps({
}
})
const emit = defineEmits(['update:modelValue', 'confirm', 'cancel'])
const emit = defineEmits(['update:modelValue', 'confirm', 'cancel', 'close'])
const isOpen = computed({
get () {
@@ -94,4 +98,7 @@ function onCancel () {
emit('cancel')
isOpen.value = false
}
function onClose () {
emit('close')
}
</script>