mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
23 lines
285 B
JavaScript
23 lines
285 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
|
|
}
|
|
}
|
|
|
|
export const getters = {
|
|
todos (state) {
|
|
return state.list
|
|
}
|
|
}
|