226dc5c147
- 使用全局计数器解决多组件并发锁定竞态问题 - 将 HTML class 注入逻辑移至 composable 中统一管理 - 优化锁定状态更新逻辑,避免重复操作 - 移除不再需要的计算属性和导入
36 lines
841 B
Vue
36 lines
841 B
Vue
<script setup lang="ts">
|
|
import { useHead, useSeoMeta } from '#imports'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
const { t } = useI18n()
|
|
|
|
// 站点通用基础信息
|
|
const siteImage = '/og-image.png'
|
|
|
|
// 配置全局 Title 模板
|
|
useHead({
|
|
titleTemplate: (titleChunk?: string) => {
|
|
const siteName = t('app.name')
|
|
return titleChunk ? `${titleChunk} - ${siteName}` : siteName
|
|
}
|
|
})
|
|
|
|
// 配置全局基础 SEO 和 Meta (响应式支持国际化)
|
|
useSeoMeta({
|
|
description: () => t('app.description'),
|
|
ogTitle: () => t('app.name'),
|
|
ogDescription: () => t('app.description'),
|
|
ogImage: siteImage,
|
|
twitterCard: 'summary_large_image',
|
|
twitterTitle: () => t('app.name'),
|
|
twitterDescription: () => t('app.description'),
|
|
twitterImage: siteImage,
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<NuxtLayout>
|
|
<NuxtPage />
|
|
</NuxtLayout>
|
|
</template>
|