import "./styles/app/tailwind.scss"
//主要
import {createApp} from 'vue'
import setupPinia from "./store/init"
import router, {setupRouter} from './router'
import App from './App.vue'

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

//简易版组织架构图
import vue3TreeOrg from 'vue3-tree-org'
import 'vue3-tree-org/lib/vue3-tree-org.css'

//hc-vue3-ui
import HcVue3UI from 'hc-vue3-ui'
import 'hc-vue3-ui/dist/index.css'
import 'hc-vue3-ui/style/index.scss'

//挂载全局
import {setupComponents} from './components/index'

//导入其它样式
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.use(vue3TreeOrg)

    // hc-vue3-ui
    app.use(HcVue3UI)

    // 组件注册全局
    setupComponents(app);

    app.mount('#app');
}

void bootstrap();
