[Vuejs]-Create multiple unique states using vuex-persistedstate in vuejs

0👍

One option that you have is to create multiple instances of your Vuex store.

Something like

document.querySelectorAll('.todo-list').forEach(list => {
   new Vue({
     el: `#${list.id}`,
     store,
     render: h => h(App)
   })
})

You might run into problems trying to manage multiple Vuex stores. See here for reference.

You might be better served taking a step back and thinking about the structure of your data. You can set up a single Vue instance, and add a boolean to your to-do list item data object.

You could also consider making localStorage reactive if it would help with your implementation.

Leave a comment