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

13 lines
164 B
JavaScript
Raw Normal View History

export default {
2017-10-31 13:43:55 +00:00
add(state, { text }) {
2016-12-25 20:16:30 +00:00
state.list.push({
text,
done: false
})
},
2017-10-31 13:43:55 +00:00
toggle(state, todo) {
2016-12-25 20:16:30 +00:00
todo.done = !todo.done
}
}