MarkK
MarkK

Reputation: 1088

Vuex store not persist 'state' when I refresh or navigate?

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

Answers (1)

Hannah
Hannah

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

Related Questions