项目微调
整合SVG图标
This commit is contained in:
@@ -25,7 +25,7 @@ import * as Icons from "@element-plus/icons-vue";
|
||||
// custom directives
|
||||
import directives from "@/directives/index";
|
||||
// vue Router
|
||||
import router from "@/routers";
|
||||
import Router from "@/routers";
|
||||
// vue i18n
|
||||
import I18n from "@/languages/index";
|
||||
// pinia store
|
||||
@@ -33,6 +33,8 @@ import pinia from "@/stores";
|
||||
// errorHandler
|
||||
import errorHandler from "@/utils/errorHandler";
|
||||
|
||||
import registerGlobComp from '@/components'
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
app.config.errorHandler = errorHandler;
|
||||
@@ -42,4 +44,20 @@ Object.keys(Icons).forEach(key => {
|
||||
app.component(key, Icons[key as keyof typeof Icons]);
|
||||
});
|
||||
|
||||
app.use(ElementPlus).use(directives).use(router).use(I18n).use(pinia).mount("#app");
|
||||
const setupAll = async () => {
|
||||
app
|
||||
.use(ElementPlus)
|
||||
.use(directives)
|
||||
.use(Router) // 使用路由
|
||||
.use(I18n)
|
||||
.use(pinia)
|
||||
.use(registerGlobComp) // 使用全局自定义组件
|
||||
|
||||
//待路由初始化完毕后,挂载app
|
||||
await Router.isReady()
|
||||
}
|
||||
|
||||
//挂载app
|
||||
setupAll().then(() => {
|
||||
app.mount('#app')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user