Global transition with JS hooks
See original GitHub issueHello đ,
I am trying to port my âvue syntax transitionâ to a more ânuxt friendlyâ solution. For now I have :
<script setup lang="ts">
const onBeforeLeave = (el) => {}
const onLeaver = (el, done) => {}
const onEnter = (el, done) => {}
const onAfterEnter = (el) => {}
</script>
<template>
<router-view v-slot="{ Component }">
<Transition
mode="out-in"
:css="false"
@before-leave="onBeforeLeave"
@leave="onLeave"
@enter="onEnter"
@after-enter="onAfterEnter"
>
<component :is="Component" />
</Transition>
</router-view>
</template>
that is working quite well. however, the following config coming from the doc doesnât seems to work in app.vue
:
<script setup lang="ts">
definePageMeta({
pageTransition: {
name: 'custom-flip',
mode: 'out-in',
onBeforeEnter: (el) => {
console.log('Before enter...')
},
onEnter: (el, done) => {},
onAfterEnter: (el) => {}
}
})
</script>
Issue Analytics
- State:
- Created a year ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Vue.js 3 Javascript Animation Transition Hooks Tutorial
Vue allows us to execute Javascript code at different stages of our animations, allowing us to build more complex animation behavior. These hooks...
Read more >Applying CSS Transitions with React Hooks | by Kaylie Kwon
We'll gradually build up to the full functionality, so let's begin with a simple hook useTransitionState that will change the state from ...
Read more >Transition Hooks - UI-Router
Global transition hooks are registered using the hook registration methods on the TransitionService (referred to as $transitions in the ...
Read more >Hooks - barba.js
Hooks are triggered by Transitions and Views , but are not âsharedâ between them: they run separately, either synchronously or asynchronously using the...
Read more >Nuxt JavaScript hooks transition - a bug? - Stack Overflow
According to the information you've provided there are a few things I would like you to notice. If you refer to the nuxt...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
itâs an upstream bug in vue. workaround at the moment is to await a nextTick().
I donât think itâs my syntax. I think itâs the same issue as https://github.com/nuxt/framework/issues/3587.