Nuxt/examples/vuex-store/store/articles.js

20 lines
274 B
JavaScript
Raw Normal View History

export const state = () => ({
2017-03-25 22:04:34 +00:00
list: [
'Lorem ipsum',
'dolor sit amet',
'consetetur sadipscing elitr'
]
})
2017-03-25 22:04:34 +00:00
export const mutations = {
2017-10-31 13:43:55 +00:00
add(state, title) {
2017-03-25 22:04:34 +00:00
state.list.push(title)
}
}
export const getters = {
2017-10-31 13:43:55 +00:00
get(state) {
2017-03-25 22:04:34 +00:00
return state.list
}
}