mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +00:00
21 lines
303 B
JavaScript
21 lines
303 B
JavaScript
|
export const state = {
|
||
|
list: []
|
||
|
}
|
||
|
|
||
|
export const mutations = {
|
||
|
add (state, { text }) {
|
||
|
state.list.push({
|
||
|
text,
|
||
|
done: false
|
||
|
})
|
||
|
},
|
||
|
|
||
|
delete (state, { todo }) {
|
||
|
state.list.splice(state.list.indexOf(todo), 1)
|
||
|
},
|
||
|
|
||
|
toggle (state, { todo }) {
|
||
|
todo.done = !todo.done
|
||
|
}
|
||
|
}
|