Vuex-persistedstate: Paths and Nested Stores

Created on 13 Nov 2020  路  5Comments  路  Source: robinvdvleuten/vuex-persistedstate

First of all, fantastic plug-in!

Question: I have some nested stores in nuxt like so: /store/pages/person.js and I tried to use this but failed:

paths: ['pages/person']

When I moved the person.js into /store/person.js and used paths: ['person'] then that worked as expected. Am curious how one could use nested store in my first example above?

Thanks so much.


  • vuex-persistedstate version: 3.0.1
  • nuxt version: 2.13.0
  • node version: 14.5.0
  • npm (or yarn) version: 6.14.5

Most helpful comment

Paths must be specified using dot notation. Try pages.person

All 5 comments

Paths must be specified using dot notation. Try pages.person

I had this same issue using Vuex modules. The dot notation in this reply worked perfectly. I didn't see dot notation used in the example docs for the Vuex modules.

Thanks for answering!

@fabiofdsantos awesome, i was looking at the example here: https://github.com/robinvdvleuten/vuex-persistedstate#example-with-vuex-modules

Thanks again this made my day so much easier! 馃槃

@fabiofdsantos thank you for solving this problem!

Was this page helpful?
0 / 5 - 0 ratings