refactor: set hydrated value in nuxt plugin
parent
b48a893614
commit
0187763c29
|
@ -1,8 +1 @@
|
|||
export const isHydrated = ref(false)
|
||||
|
||||
if (!process.server) {
|
||||
const nuxtApp = useNuxtApp()
|
||||
nuxtApp.hooks.hookOnce('app:suspense:resolve', () => {
|
||||
isHydrated.value = true
|
||||
})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.hooks.hookOnce('app:suspense:resolve', () => {
|
||||
isHydrated.value = true
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue