選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

36 行
952 B

  1. import { createSSRApp } from 'vue'
  2. import App from './App.vue'
  3. import { createPinia } from 'pinia'
  4. import uviewPlus from '@/uni_modules/uview-plus'
  5. import * as filters from '@/utils/filter.js'
  6. function lockLightTheme() {
  7. if (typeof uni === 'undefined') return
  8. try {
  9. uni.setStorageSync('u-theme-mode', 'light')
  10. } catch (e) {}
  11. if (uni.$u && typeof uni.$u.setThemePreference === 'function') {
  12. uni.$u.setThemePreference('light')
  13. }
  14. }
  15. // uni-app Vue3 入口:必须导出 createApp
  16. export function createApp() {
  17. const app = createSSRApp(App)
  18. // 状态管理:Pinia(替代旧版 Vuex)
  19. app.use(createPinia())
  20. lockLightTheme()
  21. app.use(uviewPlus)
  22. lockLightTheme()
  23. // 全局过滤器/工具(Vue3 已移除 filter,这里挂到 globalProperties 供模板使用)
  24. app.config.globalProperties.$f = filters
  25. // #ifdef H5-DEV || H5-TEST
  26. // 开发/测试环境可按需引入 vconsole
  27. // #endif
  28. return { app }
  29. }