mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-05 13:43:59 +00:00
23 lines
290 B
JavaScript
23 lines
290 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
|
|
}
|
|
}
|