官网开发中 0731
This commit is contained in:
+8
-3
@@ -4,6 +4,10 @@ import enUS from '~~/i18n/locales/en.json';
|
||||
|
||||
const { locale } = useI18n();
|
||||
|
||||
// 应用启动时拉取全局站点配置(导航/页脚/社交/i18n 词条/产品)
|
||||
const siteStore = useSiteStore();
|
||||
siteStore.init();
|
||||
|
||||
useHead({
|
||||
htmlAttrs: {
|
||||
lang: () => (locale.value === 'zh' ? 'zh-CN' : 'en-US')
|
||||
@@ -11,10 +15,11 @@ useHead({
|
||||
});
|
||||
|
||||
// 根据当前语言动态设置页面标题
|
||||
// i18n v10:useLocaleHead 选项为 { lang, dir, seo }(均默认 true)
|
||||
const head = useLocaleHead({
|
||||
addDirAttribute: true,
|
||||
identifierAttribute: 'id',
|
||||
addSeoAttributes: true
|
||||
lang: true,
|
||||
dir: true,
|
||||
seo: true
|
||||
});
|
||||
|
||||
useHead({
|
||||
|
||||
Reference in New Issue
Block a user