fix: fade in fade out + styling

This commit is contained in:
DecDuck
2025-07-27 20:25:21 +10:00
parent 50c1c21456
commit 26b12a6e8c
4 changed files with 128 additions and 188 deletions
+32 -8
View File
@@ -1,15 +1,39 @@
<template>
<component
v-for="(modal, modalIdx) in stack"
:is="modal.component"
:z-height="(modalIdx + 1) * 50"
:loading="modal.loading"
:data="modal.data"
@event="(event: string, ...args: any[]) => handleCallback(modalIdx, event, args)"
/>
<TransitionGroup name="modal">
<component
v-for="(modal, modalIdx) in stack"
:key="modal.data"
:is="modal.component"
:z-height="(modalIdx + 1) * 50"
:loading="modal.loading"
:data="modal.data"
@event="
(event: string, ...args: any[]) => handleCallback(modalIdx, event, args)
"
/>
</TransitionGroup>
<div id="modalstack" />
</template>
<style>
.modal-enter-active,
.modal-leave-active {
transition: all 0.2s ease;
}
.modal-enter-from {
opacity: 0;
}
.modal-enter-to {
opacity: 100;
}
.modal-leave-from {
opacity: 100;
}
.modal-leave-to {
opacity: 0;
}
</style>
<script setup lang="ts">
const stack = useModalStack();