Vuex persistedState does not work after refreshing page
Solution 1:
can you try applying below code
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)
export const store = new Vuex.Store({
state: {
title: ''
},
mutations: {},
actions: {},
getters: {},
plugins: [createPersistedState({
key: 'keyname',
storage: window.localStorage
})]
})
inside the "createPersistedState" you can set the path as well 'paths: ['accessRights']' as a another property. if you not provide a paths then the whole sate will be persistence