fix: 组件改用 useLocale 直读自身 i18n 实例(修复嵌入时文案回退成 key)

useI18n({ useScope: 'global' }) 在嵌入时解析到宿主已安装的 i18n 实例,
而非本子项目实例 -> mobileGame.* 文案回退成 i18n key(显示 ID)。
改为 useLocale composable 直接读本模块级 i18n.global,无论是否 app.use() 都正确。
This commit is contained in:
root
2026-07-24 08:59:35 +00:00
parent a5d4c05392
commit a91c379096
11 changed files with 34 additions and 20 deletions

View File

@@ -1,9 +1,9 @@
<script setup>
import { useI18n } from 'vue-i18n'
import { useLocale } from '../composables/useLocale.js'
import Tag from './ui/Tag.vue'
import { heroMeta } from '../config.js'
const { t } = useI18n({ useScope: 'global' })
const { t } = useLocale()
</script>
<template>