// ~/plugins/vuex-persistence.js// npm install --save vuex-persistedstate or yarn add vuex-persistedstateimportcreatePersistedStatefrom'vuex-persistedstate'/*
This little plugin is the surprisingly-easy way to make Vuex stuff persist in
a user's browser's localStorage. Super useful.
*/exportdefault({store,isHMR})=>{if(isHMR){return}window.onNuxtReady((nuxt)=>{createPersistedState()(store)})}
Just import this sucker in nuxt.config.js like so:
You're in luck - here you go:
Just import this sucker in
nuxt.config.js
like so:plugins: [
'~/plugins/vuex-persistence
]
thank you. This worked like a charm. Looking forward to reading more from you!