//主要
import { createApp } from 'vue'
import setupPinia from './store/init'
import router, { setupRouter } from './router'
import App from './App.vue'

import 'virtual:uno.css'

//饿了么UI
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'dayjs/locale/zh-cn'

//导入其它样式
import './styles/index.scss'

//创建实例
async function bootstrap() {
    const app = createApp(App)

    // 挂载状态管理
    app.use(setupPinia)

    // 挂载路由
    await setupRouter(app)

    // 路由准备就绪后挂载APP实例
    await router.isReady()

    // 饿了么UI框架
    app.use(ElementPlus, {
        locale: zhCn,
    })

    app.mount('#app')
}

void bootstrap()
