import uviewPlus from 'uview-plus'
import { createSSRApp } from 'vue'
import App from './App.vue'
import { requestInterceptor } from './http/interceptor'
import { routeInterceptor } from './router/interceptor'
import store from './store'
import { registerGlobalFilters } from './utils/directive'
import { shareMixin } from './utils/shareMixin'
import '@/style/index.scss'
import 'virtual:uno.css'

export function createApp() {
    const app = createSSRApp(App)
    // 注册全局分享函数
    app.mixin(shareMixin)

    app.use(store)
    app.use(uviewPlus)
    app.use(routeInterceptor)
    app.use(requestInterceptor)
    // 注册全局过滤器
    registerGlobalFilters(app)

    return {
        app,
    }
}
