2022-12-17 16:55:29 +00:00
|
|
|
export const isHydrated = computed(() => {
|
|
|
|
if (process.server)
|
2022-12-22 02:27:16 +00:00
|
|
|
return { value: false }
|
2022-12-17 16:55:29 +00:00
|
|
|
|
|
|
|
const nuxtApp = useNuxtApp()
|
|
|
|
if (!nuxtApp.isHydrating)
|
2022-12-22 02:27:16 +00:00
|
|
|
return { value: false }
|
2022-12-17 16:55:29 +00:00
|
|
|
|
|
|
|
const hydrated = ref(false)
|
|
|
|
nuxtApp.hooks.hookOnce('app:suspense:resolve', () => {
|
|
|
|
hydrated.value = true
|
|
|
|
})
|
|
|
|
return hydrated
|
|
|
|
})
|