Merge remote-tracking branch 'origin/cyh666666/consumer'

This commit is contained in:
comlibmb
2026-01-28 09:06:25 +08:00
59 changed files with 34946 additions and 1034 deletions

View File

@@ -4,11 +4,15 @@ import App from './App.uvue'
export function createApp() {
const app = createSSRApp(App)
// 简化的$t方法
app.config.globalProperties.$t = (key: string): string => {
return key // 直接返回key不进行翻译
}
// 注册 i18n 全局属性,使组件可以使用 $t 方法
app.config.globalProperties.$t = (key: string, values?: any, locale?: string): string => {
if (!i18n.global) {
console.error('i18n is not initialized')
return key
}
return i18n.global.t(key, values, locale) || key
}
return { app }
}