[DOCS] bug
[issue link]Hello,
Please go to https://nuxtjs.org/guide/vuex-store#modules-mode.
Example for modules does not work because it is missing with namespaced: true, for todos module.
new Vuex.Store({
state: { counter: 0 },
mutations: {
increment (state) {
state.counter++
}
},
modules: {
todos: {
namespaced: true, // <-------------<=== this line is missing
state: {
list: []
},
mutations: {
add (state, { text }) {
state.list.push({
text,
done: false
})
},
remove (state, { todo }) {
state.list.splice(state.list.indexOf(todo), 1)
},
toggle (state, { todo }) {
todo.done = !todo.done
}
}
}
}
})
Without it methods become global and they are not accessible by their namespace. IE ‘todos/toggle’.
Best regards, Arczik!