nova-admin/src/main.ts
2023-03-26 15:44:13 +08:00

30 lines
756 B
TypeScript

import { createApp } from 'vue';
import App from './App.vue';
import AppLoading from './components/common/appLoading.vue';
import { setupRouter } from './router';
import { setupAssets } from './plugins';
import { setupStore } from './store';
import { setupDirectives } from './directive'
async function setupApp() {
// 引入静态资源
setupAssets();
// 载入全局loading加载状态
const appLoading = createApp(AppLoading);
appLoading.mount('#appLoading');
// 创建vue实例
const app = createApp(App);
// 安装pinia全局状态库
setupStore(app);
// 安装自定义指令
setupDirectives(app)
// 安装router
await setupRouter(app);
// 挂载
await app.mount('#app');
// 卸载载入动画
appLoading.unmount();
}
setupApp();