Skip to content

Vue Transitions? #891

Answered by RomainMazB
jiblett1000 asked this question in Q&A
Discussion options

You must be logged in to vote

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>

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by segunadebayo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants