import { createSSRApp } from 'vue'
import App from './App.vue'
import { prototypeInterceptor, requestInterceptor, routeInterceptor } from './interceptors'
import i18n from './locale/index'
import i18nHelpers from './plugins/i18n-helpers'
import store from './store'
import '@/style/index.scss'
import 'virtual:uno.css'

uni.$zp = {
  config: {
    // 配置分页默认pageSize为20
    'default-page-size': 20,
  },
}

export function createApp() {
  const app = createSSRApp(App)
  app.use(store)
  app.use(i18n)
  app.use(i18nHelpers)
  app.use(routeInterceptor)
  app.use(requestInterceptor)
  app.use(prototypeInterceptor)

  return {
    app,
  }
}
