mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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) => {
|
||||
// If component already resolved
|
||||
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
|
||||
return _Component
|
||||
}
|
||||
|
||||
// Resolve 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
|
||||
return _Component
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user