Nuxt/examples/middleware/store/index.js

13 lines
183 B
JavaScript
Raw Normal View History

2017-07-08 17:58:07 +00:00
export const state = () => ({
2017-02-03 14:09:27 +00:00
visits: []
2017-07-08 17:58:07 +00:00
})
2017-02-03 14:09:27 +00:00
export const mutations = {
ADD_VISIT (state, path) {
2017-02-03 14:09:27 +00:00
state.visits.push({
path,
date: new Date().toJSON()
})
}
}