rubystarashe / nuxt-vuex-localstorage

MIT License
161 stars 18 forks source link

How to use for vuex module? #10

Open ansidev opened 5 years ago

ansidev commented 5 years ago

I have a Vuex module which is located at store/modules/auth.js. How to add it to nuxt-vuex-localstorage config?

akeyboardlife commented 5 years ago

If you are using Nuxt.js

the vuex module is automatically created when you create a auth.js file in store folder.

To use it:

module.exports = {
  modules: [
    ['nuxt-vuex-localstorage', {
      localStorage: ['auth']
    }]
  ]
}
linxux commented 5 years ago

Is it possible to rename the storage key?

craftsman-expert commented 4 years ago

Can a hierarchical structure be used? $store.commit('group/filters/city', val)