Reputation: 1088
Using the following example, why does Vuex store not persist 'state' when I refresh or navigate?
I've created a login that stores users state information using Vuex. This works, and I can view the user "this.$store.state" However, when I navigate to another page or refresh the "state" resets, why?
Upvotes: 0
Views: 1075
Reputation: 1143
Vuex doesn't persist state automatically. You can use the vuex-persistedstate
package to achieve this (https://github.com/robinvdvleuten/vuex-persistedstate).
Upvotes: 2