Vue Transitions? #891
Answered
by
RomainMazB
jiblett1000
asked this question in
Q&A
-
So far I have been unable to use the Vue |
Beta Was this translation helpful? Give feedback.
Answered by
RomainMazB
Jul 3, 2025
Replies: 2 comments
-
Same question. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Use the component context to feed the v-if, an example for the dialog component, using Dialog.Context (also works for HoverCard, FloatingPanel components & so on...) <Teleport to="body">
<Dialog.Context v-slot="dialog">
<Transition
enter-active-class="transition-opacity ease-out duration-300"
enter-from-class="opacity-0"
enter-to-class="opacity-100"
leave-active-class="transition-opacity ease-in duration-200"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
>
<Dialog.Backdrop v-if="dialog.open" class="fixed inset-0 bg-zinc-50/75 dark:bg-zinc-950/75"/>
</Transition>
<Dialog.Positioner class="fixed inset-0 z-10 w-screen overflow-y-auto">
<div class="flex min-h-full items-end justify-center p-4 sm:items-center sm:p-0">
<Transition
enter-active-class="transition-all ease-out duration-300"
enter-from-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
enter-to-class="opacity-100 translate-y-0 sm:scale-100"
leave-active-class="transition-all ease-in duration-200"
leave-from-class="opacity-100 translate-y-0 sm:scale-100"
leave-to-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<Dialog.Content v-if="dialog.open" :class="maxWidthClass" class="w-screen focus:outline-none">
<!-- Your modal content -->
</Dialog.Content>
</Transition>
</div>
</Dialog.Positioner>
</Dialog.Context>
</Teleport> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
segunadebayo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the component context to feed the v-if, an example for the dialog component, using Dialog.Context (also works for HoverCard, FloatingPanel components & so on...)