Updated title functions on pages
This commit is contained in:
@@ -24,8 +24,16 @@ const { data: catData, pending: catPending } = await useLazyFetch("/api/calendar
|
||||
const cal = computed<Calendar>(() => calendarData?.value?.data as Calendar)
|
||||
const categories = computed<Category[]>(() => catData?.value?.data as Category[])
|
||||
|
||||
useHead({
|
||||
title: cal.value.name
|
||||
if (cal.value) {
|
||||
useHead({
|
||||
title: cal.value.name
|
||||
})
|
||||
}
|
||||
|
||||
watch(cal, (n) => {
|
||||
useHead({
|
||||
title: n.name
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,9 +12,20 @@ const { data: res, pending } = await useFetch("/api/worlds/query", { query: { id
|
||||
|
||||
const world = ref<World>(res.value?.data as World)
|
||||
|
||||
useHead({
|
||||
title: world.value.name
|
||||
})
|
||||
if (world.value) {
|
||||
useHead({
|
||||
title: world.value.name
|
||||
})
|
||||
}
|
||||
|
||||
watch(world, (n) => {
|
||||
if (n) {
|
||||
useHead({
|
||||
title: n.name
|
||||
})
|
||||
}
|
||||
}, { deep: true })
|
||||
|
||||
definePageMeta({
|
||||
middleware: ["auth-guard"]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user