mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 10:50:40 +01:00
chore(Modal): add appear to transition child
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<TransitionRoot :appear="appear" :show="isOpen" as="template">
|
<TransitionRoot :appear="appear" :show="isOpen" as="template">
|
||||||
<Dialog @close="setIsOpen">
|
<Dialog @close="close">
|
||||||
<div class="fixed z-20 inset-0 overflow-y-auto">
|
<div class="fixed z-20 inset-0 overflow-y-auto">
|
||||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||||
<TransitionChild
|
<TransitionChild
|
||||||
as="template"
|
as="template"
|
||||||
|
:appear="appear"
|
||||||
enter="ease-out duration-300"
|
enter="ease-out duration-300"
|
||||||
enter-from="opacity-0"
|
enter-from="opacity-0"
|
||||||
enter-to="opacity-100"
|
enter-to="opacity-100"
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
|
|
||||||
<TransitionChild
|
<TransitionChild
|
||||||
as="template"
|
as="template"
|
||||||
|
:appear="appear"
|
||||||
enter="ease-out duration-300"
|
enter="ease-out duration-300"
|
||||||
enter-from="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
enter-from="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||||
enter-to="opacity-100 translate-y-0 sm:scale-100"
|
enter-to="opacity-100 translate-y-0 sm:scale-100"
|
||||||
@@ -72,7 +74,7 @@ export default {
|
|||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue'],
|
emits: ['update:modelValue', 'close'],
|
||||||
setup (props, { emit }) {
|
setup (props, { emit }) {
|
||||||
const isOpen = computed({
|
const isOpen = computed({
|
||||||
get () {
|
get () {
|
||||||
@@ -85,11 +87,9 @@ export default {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
isOpen,
|
isOpen,
|
||||||
setIsOpen (value) {
|
close (value) {
|
||||||
isOpen.value = value
|
isOpen.value = value
|
||||||
},
|
emit('close')
|
||||||
toggleIsOpen () {
|
|
||||||
isOpen.value = !isOpen.value
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user