Nuxt/examples/vuex-store-modules/store/todos.js
2017-01-15 18:51:27 +01:00

17 lines
213 B
JavaScript

export const state = {
list: []
}
export const mutations = {
add (state, { text }) {
state.list.push({
text,
done: false
})
},
toggle (state, todo) {
todo.done = !todo.done
}
}