main.ts 655 B

1234567891011121314151617181920212223242526272829
  1. import { createSSRApp } from 'vue'
  2. import App from './App.vue'
  3. import { prototypeInterceptor, requestInterceptor, routeInterceptor } from './interceptors'
  4. import i18n from './locale/index'
  5. import i18nHelpers from './plugins/i18n-helpers'
  6. import store from './store'
  7. import '@/style/index.scss'
  8. import 'virtual:uno.css'
  9. uni.$zp = {
  10. config: {
  11. // 配置分页默认pageSize为20
  12. 'default-page-size': 20,
  13. },
  14. }
  15. export function createApp() {
  16. const app = createSSRApp(App)
  17. app.use(store)
  18. app.use(i18n)
  19. app.use(i18nHelpers)
  20. app.use(routeInterceptor)
  21. app.use(requestInterceptor)
  22. app.use(prototypeInterceptor)
  23. return {
  24. app,
  25. }
  26. }