mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 初始化加载效果:应用主题颜色
This commit is contained in:
19
src/main.ts
19
src/main.ts
@ -1,22 +1,29 @@
|
||||
import { createApp } from 'vue';
|
||||
import { setupAssets } from '@/plugins';
|
||||
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() {
|
||||
const app = createApp(App);
|
||||
setupAssets();
|
||||
|
||||
// 挂载全局状态
|
||||
// 挂载 appProvider 解决路由守卫,Axios中可使用,LoadingBar,Dialog,Message 等之类组件
|
||||
const appProvider = createApp(AppProvider);
|
||||
setupStore(appProvider);
|
||||
appProvider.mount('#appProvider');
|
||||
|
||||
// 初始化加载的svg logo
|
||||
setupInitSvgLogo('#loadingLogo');
|
||||
|
||||
const app = createApp(App);
|
||||
setupStore(app);
|
||||
|
||||
// 挂载路由
|
||||
await setupRouter(app);
|
||||
|
||||
// 路由准备就绪后挂载APP实例
|
||||
// 路由准备就绪后挂载 App
|
||||
app.mount('#app');
|
||||
}
|
||||
|
||||
setupAssets();
|
||||
|
||||
setupApp();
|
||||
|
Reference in New Issue
Block a user