Pinia and Nuxt Layouts
Hey! Quick question about Pinia.
I have a very simple user store with a state and a "fetch" action that populates this state via a GQL request.
I trigger this fetch in the top-level component
But when I want to access the state in my default layout to display the user's photo like this:
Well, the console.log is empty... Yet everything is well initialized if I inspect with NuxtDevTools.
What is the issue with layouts ? Because i'm using the state of this very same store in a page and display them without any issue ...
Any idea?
I have a very simple user store with a state and a "fetch" action that populates this state via a GQL request.
I trigger this fetch in the top-level component
app.vue:But when I want to access the state in my default layout to display the user's photo like this:
Well, the console.log is empty... Yet everything is well initialized if I inspect with NuxtDevTools.
What is the issue with layouts ? Because i'm using the state of this very same store in a page and display them without any issue ...
Any idea?