Nuxt/examples/middleware/store/index.js

13 lines
182 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 = {
2017-10-31 13:43:55 +00:00
ADD_VISIT(state, path) {
2017-02-03 14:09:27 +00:00
state.visits.push({
path,
date: new Date().toJSON()
})
}
}