mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +00:00
23 lines
351 B
JavaScript
23 lines
351 B
JavaScript
|
import { nextId } from '@/lib/db'
|
||
|
|
||
|
export const state = () => {
|
||
|
return {
|
||
|
id: nextId(),
|
||
|
id2: 0
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export const mutations = {
|
||
|
setId2 (state, id) {
|
||
|
state.id2 = id
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export const actions = {
|
||
|
nuxtServerInit ({ commit, state }, { route }) {
|
||
|
if (route.query.onServerInit === '1') {
|
||
|
commit('setId2', nextId())
|
||
|
}
|
||
|
}
|
||
|
}
|