mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-03 10:57:18 +00:00
23 lines
293 B
JavaScript
23 lines
293 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
|
|
}
|
|
}
|