fix: omit value property of isHydrated in template (#681)

This commit is contained in:
三咲智子 Kevin Deng 2023-01-02 04:43:09 +08:00 committed by GitHub
parent 64611083a5
commit 645da2f945
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 19 deletions

View file

@ -1,14 +1,8 @@
export const isHydrated = computed(() => {
if (process.server)
return { value: false }
export const isHydrated = ref(false)
if (!process.server) {
const nuxtApp = useNuxtApp()
if (!nuxtApp.isHydrating)
return { value: false }
const hydrated = ref(false)
nuxtApp.hooks.hookOnce('app:suspense:resolve', () => {
hydrated.value = true
isHydrated.value = true
})
return hydrated
})
}