import { createSSRApp } from 'vue' import App from './App.vue' import { createPinia } from 'pinia' import uviewPlus from '@/uni_modules/uview-plus' import * as filters from '@/utils/filter.js' function lockLightTheme() { if (typeof uni === 'undefined') return try { uni.setStorageSync('u-theme-mode', 'light') } catch (e) {} if (uni.$u && typeof uni.$u.setThemePreference === 'function') { uni.$u.setThemePreference('light') } } // uni-app Vue3 入口:必须导出 createApp export function createApp() { const app = createSSRApp(App) // 状态管理:Pinia(替代旧版 Vuex) app.use(createPinia()) lockLightTheme() app.use(uviewPlus) lockLightTheme() // 全局过滤器/工具(Vue3 已移除 filter,这里挂到 globalProperties 供模板使用) app.config.globalProperties.$f = filters // #ifdef H5-DEV || H5-TEST // 开发/测试环境可按需引入 vconsole // #endif return { app } }