refactor(nuxt): create and use title template
This commit is contained in:
parent
c4fc0806ed
commit
c9229b6c59
14
app.vue
14
app.vue
@ -9,6 +9,8 @@
|
||||
|
||||
const dop = data?.value as any;
|
||||
let darkBool = dop?.user?.profile?.nightMode || false;
|
||||
console.log("l->", useNuxtApp().$loaded);
|
||||
useNuxtApp().$loaded.value = true;
|
||||
// provide("user", ref(dop?.user || null));
|
||||
provide("dark", darkBool);
|
||||
useHead({
|
||||
@ -17,9 +19,10 @@
|
||||
return darkBool ? "dark" : undefined;
|
||||
}).value,
|
||||
},
|
||||
titleTemplate: (title) =>
|
||||
title ? `Rockfic | ${title}` : "Rockfic | Band fiction that rocks",
|
||||
});
|
||||
let loaded = ref<boolean>(false);
|
||||
provide("loaded", loaded);
|
||||
// provide("loaded", useNuxtApp().$loaded);
|
||||
// let loaded = ref<boolean[]>([]);
|
||||
// provide("loaded", {
|
||||
// loaded,
|
||||
@ -49,12 +52,7 @@
|
||||
<i> Nothing here but crickets. </i>
|
||||
</template>
|
||||
<NuxtLayout>
|
||||
<NuxtPage v-if="$loaded" />
|
||||
<div v-else>
|
||||
<a-skeleton-title />
|
||||
<a-skeleton />
|
||||
<a-skeleton />
|
||||
</div>
|
||||
<NuxtPage />
|
||||
<!-- <NuxtWelcome /> -->
|
||||
</NuxtLayout>
|
||||
</a-config-provider>
|
||||
|
Loading…
Reference in New Issue
Block a user