Page transitions when changing store property. #2715
Unanswered
martinsnajdr
asked this question in
Help and Questions
Replies: 1 comment 1 reply
-
The first thing that comes to mind is that you are not using a
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm new to Pinia & Nuxt and so I'm trying to sort out in my head some basic ways to structure stores and use them when navigation through a simple website.
Let's say I have posts. Those posts share the same view and are loaded through Nuxt's pages/posts/[id].vue.
I want to use Page Transitions (simple fadeout/fadein) when navigating through my Nuxt app. The problem is when I navigate from /posts/1 to /posts/2, the postStore.post changes immediately and causes premature hydratation of the view. So it changes from post 1 to post 2 in a few miliseconds (which is visible) and then runs the fadeout/fadein transition. It should fadeout, hydrate, fadein.
Is my approach with storing the post in store like that a bad practice? Of course I was thinking about adding some timeout to the fetchPost when postStore.post is not null, but I don't feel it's a good practice.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions