refactor(nuxt): create and use title template

This commit is contained in:
parent c4fc0806ed
commit c9229b6c59
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

14
app.vue

@ -9,6 +9,8 @@
const dop = data?.value as any; const dop = data?.value as any;
let darkBool = dop?.user?.profile?.nightMode || false; let darkBool = dop?.user?.profile?.nightMode || false;
console.log("l->", useNuxtApp().$loaded);
useNuxtApp().$loaded.value = true;
// provide("user", ref(dop?.user || null)); // provide("user", ref(dop?.user || null));
provide("dark", darkBool); provide("dark", darkBool);
useHead({ useHead({
@ -17,9 +19,10 @@
return darkBool ? "dark" : undefined; return darkBool ? "dark" : undefined;
}).value, }).value,
}, },
titleTemplate: (title) =>
title ? `Rockfic | ${title}` : "Rockfic | Band fiction that rocks",
}); });
let loaded = ref<boolean>(false); // provide("loaded", useNuxtApp().$loaded);
provide("loaded", loaded);
// let loaded = ref<boolean[]>([]); // let loaded = ref<boolean[]>([]);
// provide("loaded", { // provide("loaded", {
// loaded, // loaded,
@ -49,12 +52,7 @@
<i> Nothing here but crickets. </i> <i> Nothing here but crickets. </i>
</template> </template>
<NuxtLayout> <NuxtLayout>
<NuxtPage v-if="$loaded" /> <NuxtPage />
<div v-else>
<a-skeleton-title />
<a-skeleton />
<a-skeleton />
</div>
<!-- <NuxtWelcome /> --> <!-- <NuxtWelcome /> -->
</NuxtLayout> </NuxtLayout>
</a-config-provider> </a-config-provider>