Add dynamic title
This commit is contained in:
@@ -18,9 +18,10 @@ const props = defineProps<{
|
||||
<span>{{ quest.pictureRequired ? '📸' : '📷' }}</span>
|
||||
<span title="aaa">{{ quest.textRequired ? '❓' : '❔' }}</span>
|
||||
<span class="mx-2">{{ quest.title }}</span>
|
||||
<VaChip v-if="quest.answer?.score" color="success" class="float-right">{{
|
||||
quest.answer?.score || 0
|
||||
}}</VaChip>
|
||||
<VaChip v-if="quest.answer?.score" color="success" class="float-right"
|
||||
>{{ quest.answer?.score || 0 }} / {{ quest.points
|
||||
}}{{ quest.extraPoints ? `+${quest.extraPoints}` : '' }}</VaChip
|
||||
>
|
||||
<VaChip v-else class="float-right"
|
||||
>{{ quest.points
|
||||
}}{{ quest.extraPoints ? ` +${quest.extraPoints}` : '' }}</VaChip
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
const app = useNuxtApp();
|
||||
const { huntSlug, questSlug } = app.$slugData;
|
||||
const { t } = useI18n();
|
||||
|
||||
useHead({
|
||||
title: t('layouts.title', {
|
||||
title:
|
||||
[questSlug?.name, huntSlug?.name].join(' | ') || t('layouts.default_tile')
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -2,12 +2,19 @@
|
||||
const app = useNuxtApp();
|
||||
const { user } = useUserSession();
|
||||
const localePath = useLocalePath();
|
||||
const { t } = useI18n();
|
||||
|
||||
const { name, id } = app.$slugData.huntSlug!;
|
||||
|
||||
const { data, pending } = await useFetch(`/api/hunt/${id}`);
|
||||
|
||||
const hideAnswers = ref(true);
|
||||
|
||||
useHead({
|
||||
title: t('layouts.title', {
|
||||
title: data.value?.name || name
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user