2024-08-08 19:08:15 +08:00
|
|
|
|
import { createApp } from 'vue'
|
2024-08-07 21:48:57 +08:00
|
|
|
|
// element-plus
|
|
|
|
|
|
import ElementPlus from 'element-plus'
|
|
|
|
|
|
import 'element-plus/dist/index.css'
|
|
|
|
|
|
|
|
|
|
|
|
// 使用pinia
|
2024-08-08 19:08:15 +08:00
|
|
|
|
import pinia from '@/stores'
|
2024-08-07 21:48:57 +08:00
|
|
|
|
|
|
|
|
|
|
import App from './App.vue'
|
2024-08-08 19:08:15 +08:00
|
|
|
|
import Router from './router/index'
|
2024-08-07 21:48:57 +08:00
|
|
|
|
|
|
|
|
|
|
// 引入tailwindcss
|
|
|
|
|
|
import '@/assets/styles/tailMain.css'
|
|
|
|
|
|
|
2024-08-08 19:08:15 +08:00
|
|
|
|
// 导入全局注册的组件
|
|
|
|
|
|
import 'virtual:svg-icons-register'
|
|
|
|
|
|
import registerGlobComp from '@/components'
|
|
|
|
|
|
|
2024-08-07 21:48:57 +08:00
|
|
|
|
//创建实例
|
|
|
|
|
|
const app = createApp(App)
|
|
|
|
|
|
const setupAll = async () => {
|
2024-08-08 19:08:15 +08:00
|
|
|
|
app
|
|
|
|
|
|
.use(Router) // 使用路由
|
|
|
|
|
|
.use(ElementPlus) // 使用ele-plus组件
|
|
|
|
|
|
.use(pinia) // 使用pinia
|
|
|
|
|
|
.use(registerGlobComp) // 使用全局自定义组件
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//待路由初始化完毕后,挂载app
|
|
|
|
|
|
await Router.isReady()
|
2024-08-07 21:48:57 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-08 19:08:15 +08:00
|
|
|
|
|
2024-08-07 21:48:57 +08:00
|
|
|
|
//挂载app
|
|
|
|
|
|
setupAll().then(() => {
|
2024-08-08 19:08:15 +08:00
|
|
|
|
app.mount('#app')
|
|
|
|
|
|
})
|
|
|
|
|
|
|