mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-17 11:15:14 +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
|
|
}
|
|
}
|