mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
[store] check if storeData.state is function for workaround
This commit is contained in:
parent
05725d70e7
commit
437586d92b
@ -33,10 +33,14 @@ for (let filename of filenames) {
|
||||
}
|
||||
|
||||
// createStore
|
||||
export const createStore = storeData === 'function' ? storeData : () => {
|
||||
return new Vuex.Store(Object.assign({}, storeData, {
|
||||
state: storeData.state() // Vuex Bug!
|
||||
}))
|
||||
export const createStore = storeData instanceof Function ? storeData : () => {
|
||||
// Vuex Bug
|
||||
if (storeData.state instanceof Function) {
|
||||
return new Vuex.Store(Object.assign({}, storeData, {
|
||||
state: storeData.state()
|
||||
}))
|
||||
}
|
||||
return new Vuex.Store(storeData)
|
||||
}
|
||||
|
||||
// Dynamically require module
|
||||
|
Loading…
Reference in New Issue
Block a user