继续完成页面的完善
This commit is contained in:
8
main.uts
8
main.uts
@@ -7,11 +7,9 @@ export function createApp() {
|
||||
|
||||
// 注册 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
|
||||
// 临时方案:移除对未定义 i18n 的引用,直接返回 Key
|
||||
// 如果之后需要 i18n,应正确导入并初始化
|
||||
return key
|
||||
}
|
||||
|
||||
return { app }
|
||||
|
||||
Reference in New Issue
Block a user