consumerm模块完成度90%,完善消费者和商家端数据库表,商品、聊天、订单数据对接好了supabase,和商家端对接了聊天功能,安卓端编译通过了css样式,剩余几个页面在处理函数规范问题
This commit is contained in:
10
main.uts
10
main.uts
@@ -1,17 +1,23 @@
|
||||
// 简化的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 => {
|
||||
if (!i18n.global) {
|
||||
if (i18n.global == null) {
|
||||
console.error('i18n is not initialized')
|
||||
return key
|
||||
}
|
||||
return i18n.global.t(key, values, locale) || 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 }
|
||||
|
||||
Reference in New Issue
Block a user