mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-18 05:58:07 +01:00
chore(AlertDialog): supper appear and close
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user