Last active
February 9, 2024 22:26
-
-
Save whaaaley/7a76a83944940956bdfbdaebb48812c9 to your computer and use it in GitHub Desktop.
How to setup Vue Router transitions with JSX inside of Vue 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { resolveDynamicComponent, Transition } from 'vue' | |
import { RouterView } from 'vue-router' | |
export default { | |
setup () { | |
return () => { | |
const slots = view => ( | |
<Transition name='fade'> | |
{resolveDynamicComponent(view.Component)} | |
</Transition> | |
) | |
return <RouterView v-slots={ slots }/> | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment