refactor(projects): 代码优化

This commit is contained in:
Soybean
2022-04-13 23:45:15 +08:00
parent 46e1ae7825
commit e8b534b84e
15 changed files with 533 additions and 479 deletions

View File

@ -1,26 +1,21 @@
import { createApp } from 'vue';
import { setupAssets } from '@/plugins';
import { setupRouter } from '@/router';
import { setupStore } from '@/store';
import { setupDirectives } from '@/directives';
import { setupImportAssets } from './plugins';
import { setupStore } from './store';
import { setupDirectives } from './directives';
import { setupRouter } from './router';
import App from './App.vue';
async function setupApp() {
// 引入静态资源
setupAssets();
setupImportAssets();
const app = createApp(App);
// 挂载pinia状态
setupStore(app);
// 挂载自定义vue指令
setupDirectives(app);
// 挂载路由
await setupRouter(app);
// 路由准备就绪后挂载 App
app.mount('#app');
}