consumerm模块完成度90%,完善消费者和商家端数据库表,商品、聊天、订单数据对接好了supabase,和商家端对接了聊天功能,安卓端编译通过了css样式,剩余几个页面在处理函数规范问题
This commit is contained in:
@@ -19,21 +19,29 @@ function t(key: string, values: UTSJSONObject | null = null, locale: string | nu
|
||||
}
|
||||
|
||||
// 创建响应式 locale 对象
|
||||
const localeObj = {
|
||||
get value(): string {
|
||||
return currentLocale
|
||||
},
|
||||
set value(newLocale: string) {
|
||||
currentLocale = newLocale
|
||||
class LocaleWrapper {
|
||||
get value(): string {
|
||||
return currentLocale
|
||||
}
|
||||
set value(newLocale: string) {
|
||||
currentLocale = newLocale
|
||||
}
|
||||
}
|
||||
const localeObj = new LocaleWrapper()
|
||||
|
||||
// I18n Global Context
|
||||
class I18nGlobal {
|
||||
t(key: string, values: UTSJSONObject | null = null, locale: string | null = null): string {
|
||||
return t(key, values, locale)
|
||||
}
|
||||
locale: LocaleWrapper = localeObj
|
||||
}
|
||||
|
||||
// 导出 i18n 对象(兼容 Vue I18n 的 API)
|
||||
const i18nInstance = {
|
||||
global: {
|
||||
t: t,
|
||||
locale: localeObj
|
||||
}
|
||||
// I18n Instance
|
||||
class I18nInstance {
|
||||
global: I18nGlobal = new I18nGlobal()
|
||||
}
|
||||
|
||||
export default i18nInstance
|
||||
// 导出 i18n 对象
|
||||
const i18n = new I18nInstance()
|
||||
export default i18n
|
||||
|
||||
Reference in New Issue
Block a user