소스 검색

icon-park按需引入

tongshangming 1 년 전
부모
커밋
046ff90037
3개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 8 0
      src/components/index.ts
  2. 2 2
      src/main.ts
  3. 1 1
      src/router/asyncRouter.ts

+ 8 - 0
src/components/index.ts

@@ -1,6 +1,7 @@
 import type { App } from 'vue'
 
 const modules = import.meta.glob('./form/*.vue', { eager: true })
+import { System, Check, MenuFoldOne, MenuUnfoldOne, Logout, SettingTwo } from '@icon-park/vue-next'
 
 function registerComponent(app: App): void {
   for (const key in modules) {
@@ -8,6 +9,13 @@ function registerComponent(app: App): void {
     const component = (modules[key] as any).default
     app.component(name, component)
   }
+
+  app.component('icon-system', System)
+  app.component('icon-check', Check)
+  app.component('icon-menu-fold-one', MenuFoldOne)
+  app.component('icon-menu-unfold-one', MenuUnfoldOne)
+  app.component('icon-logout', Logout)
+  app.component('icon-setting-two', SettingTwo)
 }
 
 export default registerComponent

+ 2 - 2
src/main.ts

@@ -6,7 +6,7 @@ import 'uno.css'
 import ElementPlus from 'element-plus'
 import 'element-plus/dist/index.css'
 import * as ElementPlusIconsVue from '@element-plus/icons-vue'
-import { install } from '@icon-park/vue-next/es/all'
+// import { install } from '@icon-park/vue-next/es/all'
 
 import registerComponent from '@/components/index'
 
@@ -115,7 +115,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
   app.component(key, component)
 }
 
-install(app)
+// install(app)
 
 // 主服务初始化微服务
 // const { initMicro } = useMainMicro()

+ 1 - 1
src/router/asyncRouter.ts

@@ -166,7 +166,7 @@ const asyncRouter: RouteRecordRaw[] = [
     name: 'list',
     meta: {
       title: '列表页',
-      icon: 'icon-list-view'
+      icon: 'Notification'
     },
     children: [
       {