Answer the question
In order to leave comments, you need to log in
How to delay the main App component when loading the user from the api?
I use vuex, I load it through firebase user and put it in vuex, when the page is reloaded, the user gets null, how to wait for the user to load to render the page, or maybe there are other options? I put the data in localstorage, but keeping the whole user there is not an option, I only store the token.
Answer the question
In order to leave comments, you need to log in
Where user data is required, use conditional rendering:
If user is needed everywhere, then first load it, and then initialize the application:
<нельзя-рендерить-без-user v-if="user">
store.dispatch('заргузитьДанныеПользователя').then(() => {
new Vue({ ... });
});
If I understood the question correctly https://stackoverflow.com/questions/48009624/vuejs...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question