mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Fix tests
This commit is contained in:
parent
b114717701
commit
9a28b8be25
@ -131,9 +131,9 @@ async function loadAsyncComponents (to, from, next) {
|
||||
}
|
||||
}
|
||||
|
||||
function applySSRData(Component) {
|
||||
function applySSRData(Component, ssrData) {
|
||||
if (NUXT.serverRendered) {
|
||||
applyAsyncData(Component, NUXT.data[index])
|
||||
applyAsyncData(Component, ssrData)
|
||||
Component._Ctor = Component
|
||||
}
|
||||
return Component
|
||||
@ -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))
|
||||
const _Component = applySSRData(sanitizeComponent(Component), NUXT.data[index])
|
||||
match.components[key] = _Component
|
||||
return _Component
|
||||
}
|
||||
|
||||
// Resolve component
|
||||
return Component().then(Component => {
|
||||
const _Component = applySSRData(sanitizeComponent(Component))
|
||||
const _Component = applySSRData(sanitizeComponent(Component), NUXT.data[index])
|
||||
match.components[key] = _Component
|
||||
return _Component
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user