Transition trouble using Laravel, VueJS & Tailwind #1809
-
Hi, I am trying to make a notification component and I can't understrand why the component is not having a transition on render. Transition <transition
enter-active-class="transform ease-out duration-500 transition"
leave-active-class="transition ease-in duration-500"
enter-class="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"
enter-to-class="translate-y-0 opacity-100 sm:translate-x-0"
leave-class="opacity-100"
leave-to-class="opacity-0"
> Blade @if (session('status'))
<notification
title="Success"
content="{{ session('status') }}"
>
</notification>
@endif I made a short video if it can help : https://streamable.com/ou593o Thanks guys ! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @anthonywebdev, For the transitions to work on the initial render, you need to use appear. https://vuejs.org/v2/guide/transitions.html#Transitions-on-Initial-Render
|
Beta Was this translation helpful? Give feedback.
-
Ok I found my problem. Thanks to @RomainLanz ! My problem was due to the SSR I am doing. Solved it by doing : async mounted() {
await setTimeout(() => {
this.show = true
}, 500);
await setTimeout(() => {
this.show = false
}, 3000);
} |
Beta Was this translation helpful? Give feedback.
Ok I found my problem. Thanks to @RomainLanz !
My problem was due to the SSR I am doing.
Solved it by doing :