Answer the question
In order to leave comments, you need to log in
How to clear vuex after sign out?
Is it possible to reset the whole vuex even if it is modular?
Answer the question
In order to leave comments, you need to log in
no, how is vuex supposed to know what values to zero to? And most importantly, what properties need to be used for this.
Formally, Alexey Yarkov is right. Just reload the page. But this is not the best approach.
Reloading the page is like restarting the entire application. All states of all components will be reset.
All style files and any other static will most likely need to be downloaded again.
It is best to do just the opposite - add a plugin for caching the state so that it persists between reboots. So that if the user opened the page in a new tab, or clicked "Refresh" in the browser, he would not be redirected anywhere, nothing would be deleted.
And for cleaning it is enough to create a separate commit in each module, which would set the default values in the state and call it when necessary.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question