From bd098c987ba5415478aff00e93b5c4bc006fe6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 9 Dec 2023 17:16:58 -0500 Subject: [PATCH] fix(server/plugins): use additional hooks to determine page readiness --- plugins/80.finish.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/80.finish.ts b/plugins/80.finish.ts index 4e543ef..178ac81 100644 --- a/plugins/80.finish.ts +++ b/plugins/80.finish.ts @@ -3,9 +3,17 @@ export default defineNuxtPlugin({ setup(nuxt) { console.log("setup start"); let loaded: Ref = ref(false); - nuxt.hook("page:finish", (comp) => { + nuxt.hook("app:beforeMount", (app) => { + loaded.value = false; + }); + nuxt.hook("page:start", (comp) => { + loaded.value = false; + // comp.$nuxt.$loaded = loaded; + }); + nuxt.hook("app:mounted", (comp) => { console.log("setup end"); - loaded.value = true; + loaded.value; + comp.$nuxt.$loaded.value = loaded.value = true; }); return { provide: {