feat(header): 实现动态标题和副标题显示

This commit is contained in:
scout 2025-01-13 11:25:37 +08:00
parent 7fb3599feb
commit 36611ab0e9

View File

@ -14,11 +14,16 @@ function onBack() {
const { t } = useI18n()
const title = computed(() => {
if (!route.meta)
return ''
return route.meta.i18n ? t(route.meta.i18n) : (route.meta.title || '')
})
const subTitle = computed(() => {
if (!route.meta)
return ''
return route.meta.subTitle ? t(route.meta.subTitle) : ''
})
const showLeftArrow = computed(() => route.name && routeWhiteList.includes(route.name))
</script>
@ -31,8 +36,8 @@ const showLeftArrow = computed(() => route.name && routeWhiteList.includes(route
>
<template #title>
<div class="flex flex-col items-center justify-center">
<div class="text-#000000 text-17px mb-5px font-600">京都拍卖会</div>
<div class="text-#939393 text-10px line-height-none font-100">2025.01.18 蒙娜丽莎的微笑</div>
<div class="text-#000000 text-17px mb-5px font-600">{{ title }}</div>
<div class="text-#939393 text-10px line-height-none font-100">{{subTitle}}</div>
</div>
</template>
</VanNavBar>