79449227

Date: 2025-02-18 18:10:49
Score: 1
Natty:
Report link

Thanks to user Mohkoma for sharing this solution, it helped me a lot to implement transitions in my project with Inertia. I just wanted to make a small improvement: if you wrap the only around the main content, instead of spanning the entire page, the animation will affect only the content and not the header or footer. Here is an example of how I implemented it:

<template>
    <AppHeader />
    <main class="max-w-7xl">
        <Transition name="fade" mode="out-in" appear>
            <div :key="$page.url">
                <slot />
            </div>
        </Transition>
    </main>
    <AppFooter />
</template>
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (1): helped me a lot
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Erik Jhordy