[Vuejs]-Am I doing this right? VueX and Vue.js

0👍

Just add a mutation for setting the notes

setNotes(state, notes) {
    state.notes = notes
 }

then commit the mutation from your action:

getItems({commit}) {
    localStorage.getItem("notes")
    .then(data => commit('setNotes', data) )
 }

Leave a comment