diff --git a/.env.base b/.env.base index e32c0fa..8f60256 100644 --- a/.env.base +++ b/.env.base @@ -15,3 +15,6 @@ VITE_USE_ALL_ELEMENT_PLUS_STYLE=true # 是否开启mock VITE_USE_MOCK=true + +# 是否使用在线图标 +VITE_USE_ONLINE_ICON=true \ No newline at end of file diff --git a/.env.dev b/.env.dev index 6405df1..d74dc3b 100644 --- a/.env.dev +++ b/.env.dev @@ -32,4 +32,7 @@ VITE_USE_ALL_ELEMENT_PLUS_STYLE=false VITE_USE_MOCK=true # 是否切割css -VITE_USE_CSS_SPLIT=false \ No newline at end of file +VITE_USE_CSS_SPLIT=false + +# 是否使用在线图标 +VITE_USE_ONLINE_ICON=true \ No newline at end of file diff --git a/.env.gitee b/.env.gitee index 45941a8..d190ddc 100644 --- a/.env.gitee +++ b/.env.gitee @@ -32,4 +32,7 @@ VITE_USE_ALL_ELEMENT_PLUS_STYLE=false VITE_USE_MOCK=true # 是否切割css -VITE_USE_CSS_SPLIT=false \ No newline at end of file +VITE_USE_CSS_SPLIT=false + +# 是否使用在线图标 +VITE_USE_ONLINE_ICON=true \ No newline at end of file diff --git a/.env.pro b/.env.pro index aac4b0a..06aad7f 100644 --- a/.env.pro +++ b/.env.pro @@ -32,4 +32,7 @@ VITE_USE_ALL_ELEMENT_PLUS_STYLE=false VITE_USE_MOCK=true # 是否切割css -VITE_USE_CSS_SPLIT=true \ No newline at end of file +VITE_USE_CSS_SPLIT=true + +# 是否使用在线图标 +VITE_USE_ONLINE_ICON=true \ No newline at end of file diff --git a/package.json b/package.json index 030bef9..fd88b0c 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ }, "dependencies": { "@iconify/iconify": "^3.1.1", + "@iconify/vue": "^4.1.1", "@vueuse/core": "^10.7.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10", diff --git a/src/components/Icon/src/Icon.vue b/src/components/Icon/src/Icon.vue index bb36164..1b5bc4c 100644 --- a/src/components/Icon/src/Icon.vue +++ b/src/components/Icon/src/Icon.vue @@ -3,6 +3,7 @@ import { computed, unref } from 'vue' import { ElIcon } from 'element-plus' import { propTypes } from '@/utils/propTypes' import { useDesign } from '@/hooks/web/useDesign' +import { Icon } from '@iconify/vue' const { getPrefixCls } = useDesign() @@ -24,6 +25,11 @@ const symbolId = computed(() => { return unref(isLocal) ? `#icon-${props.icon.split('svg-icon:')[1]}` : props.icon }) +// 是否使用在线图标 +const isUseOnline = computed(() => { + return import.meta.env.VITE_USE_ONLINE_ICON === 'true' +}) + const getIconifyStyle = computed(() => { const { color, size } = props return { @@ -39,15 +45,18 @@ const getIconifyStyle = computed(() => { - -
+