Answer the question
In order to leave comments, you need to log in
How to write to localStorage via axios before app loads?
My application must receive data from another server in order to work, if this data is not received, all pages in the router must be disabled until the data is received except the main one.
The data I receive in beforeEach
But the matter is that for the very first time they come later than the component is created. Therefore, in the component
mydata = null
data() {
return {
mydata: JSON.parse(localStorage.getItem('mydata')),
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question