mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-18 10:17:16 +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
|
|
}
|
|
}
|