Files
soybean-admin/src/main.ts

30 lines
750 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { createApp } from 'vue';
import { setupAssets, setupInitSvgLogo } from '@/plugins';
import { setupRouter } from '@/router';
import { setupStore } from '@/store';
import AppProvider from './AppProvider.vue';
import App from './App.vue';
async function setupApp() {
setupAssets();
// 挂载 appProvider 解决路由守卫Axios中可使用LoadingBarDialogMessage 等之类组件
const appProvider = createApp(AppProvider);
setupStore(appProvider);
appProvider.mount('#appProvider');
// 初始化加载的svg logo
setupInitSvgLogo('#loadingLogo');
const app = createApp(App);
setupStore(app);
// 挂载路由
await setupRouter(app);
// 路由准备就绪后挂载 App
app.mount('#app');
}
setupApp();