项目微调
整合SVG图标
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'SvgIcon',
|
name: 'SvgIcon',
|
||||||
})
|
})
|
||||||
import { computed } from 'vue'
|
|
||||||
import type { CSSProperties } from 'vue'
|
import type { CSSProperties } from 'vue'
|
||||||
// 定义组件对外暴露的props
|
// 定义组件对外暴露的props
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import * as Icons from "@element-plus/icons-vue";
|
|||||||
// custom directives
|
// custom directives
|
||||||
import directives from "@/directives/index";
|
import directives from "@/directives/index";
|
||||||
// vue Router
|
// vue Router
|
||||||
import router from "@/routers";
|
import Router from "@/routers";
|
||||||
// vue i18n
|
// vue i18n
|
||||||
import I18n from "@/languages/index";
|
import I18n from "@/languages/index";
|
||||||
// pinia store
|
// pinia store
|
||||||
@@ -33,6 +33,8 @@ import pinia from "@/stores";
|
|||||||
// errorHandler
|
// errorHandler
|
||||||
import errorHandler from "@/utils/errorHandler";
|
import errorHandler from "@/utils/errorHandler";
|
||||||
|
|
||||||
|
import registerGlobComp from '@/components'
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
app.config.errorHandler = errorHandler;
|
app.config.errorHandler = errorHandler;
|
||||||
@@ -42,4 +44,20 @@ Object.keys(Icons).forEach(key => {
|
|||||||
app.component(key, Icons[key as keyof typeof Icons]);
|
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')
|
||||||
|
})
|
||||||
|
|||||||
@@ -200,7 +200,6 @@ onMounted(() => {
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
line-height: 20px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
Reference in New Issue
Block a user