import createPersistedState from 'vuex-persistedstate'
export default ({ store }) => {
createPersistedState({
key: 'applocal',
storage: window.localStorage,
overwrite: true,
})(store)
}
When I reload the page data is restored from localStore to Vuex. But I am unable to access the data from the page. I have tried accessing the data from Nuxt lifehooks.
I have tried this both in ssr and spa modes and the result is the same.
Setup:
nuxt
2.15.7:vuex-persistedstate
4.1.0:node
16.13.1:yarn
1.22.15:plugins/persistedstate.js
When I reload the page data is restored from
localStore
to Vuex. But I am unable to access the data from the page. I have tried accessing the data from Nuxt lifehooks.I have tried this both in
ssr
andspa
modes and the result is the same.