2021-05-28 00:32:34 +08:00
|
|
|
import { createApp } from 'vue';
|
2022-02-17 00:58:55 +08:00
|
|
|
import { setupAssets, setupNaiveUI } from '@/plugins';
|
2022-01-03 22:20:10 +08:00
|
|
|
import { setupRouter } from '@/router';
|
|
|
|
import { setupStore } from '@/store';
|
2022-01-22 02:25:59 +08:00
|
|
|
import { setupDirectives } from '@/directives';
|
2021-05-28 00:32:34 +08:00
|
|
|
import App from './App.vue';
|
2021-11-14 22:16:44 +08:00
|
|
|
|
2021-08-18 12:02:59 +08:00
|
|
|
async function setupApp() {
|
2022-01-06 02:00:42 +08:00
|
|
|
// 引入静态资源
|
2022-01-04 13:53:07 +08:00
|
|
|
setupAssets();
|
|
|
|
|
|
|
|
const app = createApp(App);
|
2022-01-18 01:17:09 +08:00
|
|
|
|
|
|
|
// 挂载pinia状态
|
2021-08-18 12:02:59 +08:00
|
|
|
setupStore(app);
|
|
|
|
|
2022-01-22 02:25:59 +08:00
|
|
|
// 挂载自定义vue指令
|
|
|
|
setupDirectives(app);
|
|
|
|
|
2022-02-17 00:58:55 +08:00
|
|
|
// 按需引入naiveUI
|
|
|
|
setupNaiveUI(app);
|
|
|
|
|
2021-08-18 12:02:59 +08:00
|
|
|
// 挂载路由
|
2021-09-09 12:00:18 +08:00
|
|
|
await setupRouter(app);
|
2021-08-18 12:02:59 +08:00
|
|
|
|
2022-01-04 13:53:07 +08:00
|
|
|
// 路由准备就绪后挂载 App
|
2021-11-19 21:39:29 +08:00
|
|
|
app.mount('#app');
|
2021-08-18 12:02:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
setupApp();
|