Nuxt/examples/vuex-store-2/store/todos.js

17 lines
213 B
JavaScript
Raw Normal View History

2016-12-25 20:16:30 +00:00
export const state = {
list: []
}
export const mutations = {
add (state, { text }) {
state.list.push({
text,
done: false
})
},
2017-01-09 14:10:01 +00:00
toggle (state, todo) {
2016-12-25 20:16:30 +00:00
todo.done = !todo.done
}
}