mirror of
https://github.com/elk-zone/elk
synced 2024-11-23 14:46:08 +09:00
refactor: set hydrated value in nuxt plugin
This commit is contained in:
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
|
||||
})
|
||||
}
|
||||
|
5
plugins/hydration.client.ts
Normal file
5
plugins/hydration.client.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.hooks.hookOnce('app:suspense:resolve', () => {
|
||||
isHydrated.value = true
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue
Block a user