mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +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,
|
||||
flatMapComponents,
|
||||
setContext,
|
||||
<% if (features.transitions) { %>getLocation,<% } %>
|
||||
<% if (features.transitions || features.asyncData || features.fetch) { %>getLocation,<% } %>
|
||||
compile,
|
||||
getQueryDiff,
|
||||
globalHandleError
|
||||
@ -186,7 +186,7 @@ function mapTransitions (Components, to, from) {
|
||||
}
|
||||
}
|
||||
|
||||
<% if (features.transitions) { %>
|
||||
<% if (features.transitions || features.asyncData || features.fetch) { %>
|
||||
function applySSRData (Component, ssrData) {
|
||||
<% if (features.asyncData) { %>
|
||||
if (NUXT.serverRendered && ssrData) {
|
||||
@ -796,6 +796,8 @@ function addHotReload ($component, depth) {
|
||||
_app.setTransitions(mapTransitions(Components, router.currentRoute))
|
||||
_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
|
||||
_app.$loading = {} // To avoid error while _app.$nuxt does not exist
|
||||
|
Loading…
Reference in New Issue
Block a user