mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-29 11:20:36 +01:00
chore(AlertDialog): supper appear and close
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<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 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">
|
<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" />
|
<Icon :name="icon" :class="iconClass" />
|
||||||
@@ -33,6 +33,10 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
appear: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
icon: {
|
icon: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
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({
|
const isOpen = computed({
|
||||||
get () {
|
get () {
|
||||||
@@ -94,4 +98,7 @@ function onCancel () {
|
|||||||
emit('cancel')
|
emit('cancel')
|
||||||
isOpen.value = false
|
isOpen.value = false
|
||||||
}
|
}
|
||||||
|
function onClose () {
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user