Making only one module persistent with vuex-persistedstate Making only one module persistent with vuex-persistedstate vue.js vue.js

Making only one module persistent with vuex-persistedstate


Looking at the API docs, you will need to configure the plugin to only persist a certain subset of the store.

export default new Vuex.Store({  plugins: [    createPersistedState({      paths: ['user'],    }),  ],});

From the docs above:

paths <Array>: An array of any paths to partially persist the state. If no paths are given, the complete state is persisted. Paths must be specified using dot notation. If using modules, include the module name. eg: "auth.user" (default: [])