mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
fix(vue-app): fix asyncData hydration when features.transition: false (#6433)
This commit is contained in:
parent
3b9eddc223
commit
ec6ef6e425
@ -11,7 +11,7 @@ import {
|
|||||||
getMatchedComponentsInstances,
|
getMatchedComponentsInstances,
|
||||||
flatMapComponents,
|
flatMapComponents,
|
||||||
setContext,
|
setContext,
|
||||||
<% if (features.transitions) { %>getLocation,<% } %>
|
<% if (features.transitions || features.asyncData || features.fetch) { %>getLocation,<% } %>
|
||||||
compile,
|
compile,
|
||||||
getQueryDiff,
|
getQueryDiff,
|
||||||
globalHandleError
|
globalHandleError
|
||||||
@ -186,7 +186,7 @@ function mapTransitions (Components, to, from) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<% if (features.transitions) { %>
|
<% if (features.transitions || features.asyncData || features.fetch) { %>
|
||||||
function applySSRData (Component, ssrData) {
|
function applySSRData (Component, ssrData) {
|
||||||
<% if (features.asyncData) { %>
|
<% if (features.asyncData) { %>
|
||||||
if (NUXT.serverRendered && ssrData) {
|
if (NUXT.serverRendered && ssrData) {
|
||||||
@ -796,6 +796,8 @@ function addHotReload ($component, depth) {
|
|||||||
_app.setTransitions(mapTransitions(Components, router.currentRoute))
|
_app.setTransitions(mapTransitions(Components, router.currentRoute))
|
||||||
_lastPaths = router.currentRoute.matched.map(route => compile(route.path)(router.currentRoute.params))
|
_lastPaths = router.currentRoute.matched.map(route => compile(route.path)(router.currentRoute.params))
|
||||||
}
|
}
|
||||||
|
<% } else if (features.asyncData || features.fetch) { %>
|
||||||
|
await Promise.all(resolveComponents(router))
|
||||||
<% } %>
|
<% } %>
|
||||||
// Initialize error handler
|
// Initialize error handler
|
||||||
_app.$loading = {} // To avoid error while _app.$nuxt does not exist
|
_app.$loading = {} // To avoid error while _app.$nuxt does not exist
|
||||||
|
Loading…
Reference in New Issue
Block a user