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