I want a custom page transition with dynamic content. With dynamic content I mean changing the color of the transition based on the clicked item. I am storing the selected color in a store, which works fine. But when the first card is clicked the default color appears in the transition. It seems that the beforeEnter(el) hook is not working properly and sets the new color after the first page transition.
In pages/index.vue
transition(to, from) {
if(to.name === "referenz") {
// returns a string
return 'home';
}
return {
name: 'home',
mode: "",
beforeEnter(el) {
el.style.backgroundColor = this.$store.getters.getTransitionHEX
},
}
},