Nuxt/test/fixtures/ssr/store/index.js
Dmitry Molotkov df148a896e fix: properly serialize undefined in vuex store (#3913)
* allow to serialize undefined variable in vuex store

* test properly

* fix test

* lock
2018-09-25 10:51:07 +02:00

24 lines
377 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())
}
}
}