a6b65ae918
这些页面未调用 usePageSeo,SSR 产物里没有 <title>,浏览器标签页显示 URL。 - login / register / forgot-password / change-password / buy / renewal / preview 统一按 contact.vue 的既有写法:await fetchSiteInfo() 后调 usePageSeo, 标题自动带上站点品牌后缀 - preview 页仅供内部调试,追加 robots: noindex,nofollow 避免被收录 - cases.vue 是 /cases → /case 的纯重定向壳,无需标题,未改动
42 lines
1.1 KiB
Vue
42 lines
1.1 KiB
Vue
<template>
|
||
<div>
|
||
<Component :is="templatePage" v-if="templatePage" />
|
||
</div>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
/**
|
||
* 模板预览路由
|
||
* 可通过 /preview?templateId=template-02 预览指定模板
|
||
*/
|
||
const route = useRoute()
|
||
const previewTemplateId = route.query.templateId as string
|
||
|
||
const { loadTemplate, registerTemplate } = useTemplate()
|
||
const { siteInfo, fetchSiteInfo } = useSite()
|
||
|
||
// 先取站点信息,保证标题能带上品牌名(与其它页面一致)
|
||
await fetchSiteInfo()
|
||
|
||
usePageSeo(
|
||
{
|
||
title: '模板预览',
|
||
path: '/preview'
|
||
},
|
||
siteInfo.value
|
||
)
|
||
|
||
// 预览页仅供内部调试,不希望被搜索引擎收录
|
||
useSeoMeta({ robots: 'noindex, nofollow' })
|
||
|
||
// 注册所有模板
|
||
const templates = await import('~/templates')
|
||
templates.default.forEach(registerTemplate)
|
||
|
||
const templatePage = shallowRef<Component | null>(null)
|
||
|
||
// 同步加载当前模板(SSR/客户端路由切换均直接 await,避免先闪 SiteLoading)
|
||
const components = await loadTemplate(previewTemplateId)
|
||
templatePage.value = components?.Home || null
|
||
</script>
|