mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
[store] fix condition where root store is not exporting state
This commit is contained in:
parent
437586d92b
commit
0220be4466
@ -34,13 +34,9 @@ for (let filename of filenames) {
|
||||
|
||||
// createStore
|
||||
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)
|
||||
return new Vuex.Store(Object.assign({}, storeData, {
|
||||
state: storeData.state instanceof Function ? storeData.state() : {}
|
||||
}))
|
||||
}
|
||||
|
||||
// Dynamically require module
|
||||
|
Loading…
Reference in New Issue
Block a user