mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt): await asyncData if ssr: false
(#4791)
This commit is contained in:
parent
b29f635646
commit
87c62513fa
@ -144,7 +144,7 @@ export function useAsyncData<
|
||||
if (fetchOnServer && nuxt.isHydrating && key in nuxt.payload.data) {
|
||||
// 1. Hydration (server: true): no fetch
|
||||
asyncData.pending.value = false
|
||||
} else if (instance && (nuxt.isHydrating || options.lazy)) {
|
||||
} else if (instance && nuxt.payload.serverRendered && (nuxt.isHydrating || options.lazy)) {
|
||||
// 2. Initial load (server: false): fetch on mounted
|
||||
// 3. Navigation (lazy: true): fetch on mounted
|
||||
instance._nuxtOnBeforeMountCbs.push(initialFetch)
|
||||
|
Loading…
Reference in New Issue
Block a user