I've been attempting to incorporate layout transitions into my Nuxt 3 project, but unfortunately, it's not working as expected. I even resorted to replicating the code directly from the Nuxt transition documentation, only to face another failure. Can someone please assist me with this issue? Below is the code snippet:
app.vue file
<div>
<NuxtLayout>
<NuxtPage/>
</NuxtLayout>
</div>
</template>
<style>
.layout-enter-active,
.layout-leave-active {
transition: opacity 2s;
}
.layout-enter-from,
.layout-leave-to {
opacity: 0;
}
</style>
nuxt.config.ts file
export default defineNuxtConfig({
app: {
layoutTransition: {
name: 'layout',
mode: 'out-in'}
},
modules: ['nuxt-icon', '@nuxtjs/tailwindcss'],
css: ['~/assets/css/main.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
pages: true,
})
[1]: https://nuxt.com/docs/getting-started/transitions