Nuxt/test/fixtures/ssr/store/index.js
pooya parsa e7cc2757c3 refactor: update eslint-config to 1.x
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2019-07-10 15:15:49 +04:30

24 lines
379 B
JavaScript

import { nextId } from '@/lib/db'
export const state = () => {
return {
id: nextId(),
id2: 0,
idUndefined: undefined
}
}
export const mutations = {
setId2 (state, id) {
state.id2 = id
}
}
export const actions = {
nuxtServerInit ({ commit, state }, { route }) {
if (route.query.onServerInit === '1') {
commit('setId2', nextId())
}
}
}