44 lines
830 B
TypeScript
44 lines
830 B
TypeScript
import { createApp } from "vue";
|
|
|
|
import App from "./App.vue";
|
|
|
|
import { setupStore } from "./store";
|
|
//使用了Top await
|
|
import { setupRouter } from "./router";
|
|
import { setupI18n } from "./locales";
|
|
|
|
import {
|
|
setupAntd,
|
|
setupAssets,
|
|
setupCustomComponents,
|
|
setupVuePhoto,
|
|
} from "./plugins";
|
|
|
|
const app = createApp(App);
|
|
|
|
function setupPlugins() {
|
|
// 注册全局常用的ant-design-vue组件
|
|
setupAntd(app);
|
|
// 注册全局常用的VuePhoto组件
|
|
setupVuePhoto(app);
|
|
// 引入静态资源
|
|
setupAssets();
|
|
// 注册全局自定义组件,如:<svg-icon />
|
|
setupCustomComponents(app);
|
|
}
|
|
|
|
async function setupApp() {
|
|
// 挂载pinia状态管理
|
|
setupStore(app);
|
|
// 挂载路由
|
|
await setupRouter(app);
|
|
// 初始化 i18n
|
|
await setupI18n(app);
|
|
|
|
app.mount("#app");
|
|
}
|
|
|
|
setupPlugins();
|
|
|
|
setupApp();
|