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