Files
medical-mall/main.uts
2026-03-18 20:34:55 +08:00

31 lines
875 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 简化的main.uts移除i18n依赖
import { createSSRApp } from 'vue'
import App from './App.uvue'
import i18n from '@/uni_modules/i18n/index.uts'
export function createApp() {
const app = createSSRApp(App)
// 注册 i18n 全局属性,使组件可以使用 $t 方法
app.config.globalProperties.$t = (key: string, values?: any, locale?: string): string => {
//hzb
// 临时方案:移除对未定义 i18n 的引用,直接返回 Key
// 如果之后需要 i18n应正确导入并初始化
return key
//cyh
// if (i18n.global == null) {
// console.error('i18n is not initialized')
// return key
// }
// const params = values as UTSJSONObject | null
// const res = i18n.global.t(key, params, locale)
// if (res.length > 0) {
// return res
// }
// return key
}
return { app }
}