diff --git a/.eslintignore b/.eslintignore index f911aced..5c47d603 100644 --- a/.eslintignore +++ b/.eslintignore @@ -12,5 +12,4 @@ lib .vscode .local package.json -components.d.ts !.env-config.ts diff --git a/build/plugins/iconify.ts b/build/plugins/iconify.ts deleted file mode 100644 index f7b73745..00000000 --- a/build/plugins/iconify.ts +++ /dev/null @@ -1,21 +0,0 @@ -import Icons from 'unplugin-icons/vite'; // iconify图标 -import IconsResolver from 'unplugin-icons/resolver'; -import Components from 'unplugin-vue-components/vite'; // 从指定目录自动导入组件 -import { FileSystemIconLoader } from 'unplugin-icons/loaders'; - -export default (srcPath: string) => { - return [ - Icons({ - compiler: 'vue3', - customCollections: { - custom: FileSystemIconLoader(`${srcPath}/assets/svg`), - }, - scale: 1, - defaultClass: 'inline-block', - }), - Components({ - dts: true, - resolvers: [IconsResolver({ customCollections: ['custom'], componentPrefix: 'icon' })], - }), - ]; -}; diff --git a/components.d.ts b/components.d.ts index 21d64716..68db9753 100644 --- a/components.d.ts +++ b/components.d.ts @@ -13,11 +13,11 @@ declare module 'vue' { IconAntDesignCloseOutlined: typeof import('~icons/ant-design/close-outlined')['default']; IconAntDesignEnterOutlined: typeof import('~icons/ant-design/enter-outlined')['default']; IconAntDesignSettingOutlined: typeof import('~icons/ant-design/setting-outlined')['default']; + IconCustomActivity: typeof import('~icons/custom/activity')['default']; IconCustomAvatar: typeof import('~icons/custom/avatar')['default']; - IconCustomEmptyData: typeof import('~icons/custom/empty-data')['default']; + IconCustomCast: typeof import('~icons/custom/cast')['default']; IconCustomLogo: typeof import('~icons/custom/logo')['default']; IconCustomLogoFill: typeof import('~icons/custom/logo-fill')['default']; - IconCustomNetworkError: typeof import('~icons/custom/network-error')['default']; IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default']; IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default']; IconIcOutlineCheck: typeof import('~icons/ic/outline-check')['default']; diff --git a/src/components/business/index.ts b/src/components/business/index.ts deleted file mode 100644 index 477205bc..00000000 --- a/src/components/business/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import LoadingEmptyWrapper from './LoadingEmptyWrapper.vue'; -import LoginAgreement from './LoginAgreement.vue'; - -export { LoadingEmptyWrapper, LoginAgreement }; diff --git a/src/components/common/index.ts b/src/components/common/index.ts deleted file mode 100644 index 04155a1b..00000000 --- a/src/components/common/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import NaiveProvider from './NaiveProvider.vue'; -import SystemLogo from './SystemLogo.vue'; -import DarkModeSwitch from './DarkModeSwitch.vue'; -import DarkModeContainer from './DarkModeContainer.vue'; -import HoverContainer from './HoverContainer.vue'; - -export { NaiveProvider, SystemLogo, DarkModeSwitch, DarkModeContainer, HoverContainer }; diff --git a/src/components/custom/index.ts b/src/components/custom/index.ts deleted file mode 100644 index 5ea953ce..00000000 --- a/src/components/custom/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import BetterScroll from './BetterScroll.vue'; -import CountTo from './CountTo.vue'; -import ImageVerify from './ImageVerify.vue'; -import WebSiteLink from './WebSiteLink.vue'; -import GithubLink from './GithubLink.vue'; -import IconSelect from './IconSelect.vue'; - -export { BetterScroll, CountTo, ImageVerify, WebSiteLink, GithubLink, IconSelect }; diff --git a/src/components/index.ts b/src/components/index.ts deleted file mode 100644 index 8b20070f..00000000 --- a/src/components/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './custom'; -export * from './common'; -export * from './business'; diff --git a/src/views/plugin/icon/index.vue b/src/views/plugin/icon/index.vue index a7f71bad..53fd4fd2 100644 --- a/src/views/plugin/icon/index.vue +++ b/src/views/plugin/icon/index.vue @@ -17,25 +17,18 @@ -
在src/assets下的svg文件,通过在template里面以 icon-custom-{文件名} 渲染
+
+ 在src/assets/svg文件夹下的svg文件,通过在template里面以 icon-custom-{文件名} 直接渲染,动态渲染需要import组件 +
- +
- +
-
- -
-
- -
-
- -
-
- +
+
@@ -46,7 +39,15 @@ import { ref } from 'vue'; import { Icon } from '@iconify/vue'; import { icons } from './icons'; +import CustomActivity from '~icons/custom/activity'; +import CustomAtSign from '~icons/custom/at-sign'; +import CustomCast from '~icons/custom/cast'; +import CustomChrome from '~icons/custom/chrome'; +import CustomCopy from '~icons/custom/copy'; +import CustomWind from '~icons/custom/wind'; const selectValue = ref(''); + +const customIcons = [CustomActivity, CustomAtSign, CustomCast, CustomChrome, CustomCopy, CustomWind];