2017-07-03 18:19:22 +00:00
|
|
|
import { nextId } from '@/lib/db'
|
|
|
|
|
|
|
|
export const state = () => {
|
|
|
|
return {
|
|
|
|
id: nextId(),
|
2018-09-25 08:51:07 +00:00
|
|
|
id2: 0,
|
|
|
|
idUndefined: undefined
|
2017-07-03 18:19:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export const mutations = {
|
2017-10-31 13:26:19 +00:00
|
|
|
setId2(state, id) {
|
2017-07-03 18:19:22 +00:00
|
|
|
state.id2 = id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export const actions = {
|
2017-10-31 13:26:19 +00:00
|
|
|
nuxtServerInit({ commit, state }, { route }) {
|
2017-07-03 18:19:22 +00:00
|
|
|
if (route.query.onServerInit === '1') {
|
|
|
|
commit('setId2', nextId())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|