mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-13 09:33:54 +00:00
fix NUXT.data for SPA
This commit is contained in:
parent
9a28b8be25
commit
4d5255e805
@ -146,14 +146,14 @@ function resolveComponents(router) {
|
|||||||
return flatMapComponents(router.match(path), (Component, _, match, key, index) => {
|
return flatMapComponents(router.match(path), (Component, _, match, key, index) => {
|
||||||
// If component already resolved
|
// If component already resolved
|
||||||
if (typeof Component !== 'function' || Component.options) {
|
if (typeof Component !== 'function' || Component.options) {
|
||||||
const _Component = applySSRData(sanitizeComponent(Component), NUXT.data[index])
|
const _Component = applySSRData(sanitizeComponent(Component), NUXT.data ? NUXT.data[index] : null)
|
||||||
match.components[key] = _Component
|
match.components[key] = _Component
|
||||||
return _Component
|
return _Component
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve component
|
// Resolve component
|
||||||
return Component().then(Component => {
|
return Component().then(Component => {
|
||||||
const _Component = applySSRData(sanitizeComponent(Component), NUXT.data[index])
|
const _Component = applySSRData(sanitizeComponent(Component), NUXT.data ? NUXT.data[index] : null)
|
||||||
match.components[key] = _Component
|
match.components[key] = _Component
|
||||||
return _Component
|
return _Component
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user