/*
 * @Author: Gaoxs
 * @Date: 2023-04-07 15:12:06
 * @LastEditors: Gaoxs
 * @Description:
 */
import util from '@/utils'

import App from './App'
import uvUI from '@/uni_modules/uv-ui-tools'

// #ifdef H5
import VConsole from 'vconsole'
// #endif
import { createPinia } from 'pinia'

import { createSSRApp } from 'vue'

export function createApp() {
    const app = createSSRApp(App)
    app.use(util)
    app.use(createPinia())
    app.use(uvUI);
    uni.$uv.setConfig({
        config: {
            // 修改默认单位为rpx，相当于执行 uni.$uv.config.unit = 'rpx'
        },
        props: {
            datetimePicker: {
                color: {
                    default: 'red'
                },
                confirmColor: {
                    default: '#EE6D46'
                }
            },
            picker: {
                confirmColor: {
                    default: '#EE6D46'
                }
            }
        }
    })
    // #ifdef H5
    const vConsole = new VConsole()
    app.use(vConsole)
    // #endif
    return {
        app,
    }
}
