You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
310 B
20 lines
310 B
export const state = () => ({
|
|
list: []
|
|
})
|
|
|
|
export const mutations = {
|
|
add(state, text) {
|
|
state.list.push({
|
|
text: text,
|
|
done: false
|
|
})
|
|
},
|
|
remove(state, {
|
|
todo
|
|
}) {
|
|
state.list.splice(state.list.indexOf(todo), 1)
|
|
},
|
|
toggle(state, todo) {
|
|
todo.done = !todo.done
|
|
}
|
|
}
|
|
|