From 608bf50e1cae49b7f97587395f794ae351f833f0 Mon Sep 17 00:00:00 2001 From: kailong321200875 <321200875@qq.com> Date: Tue, 26 Dec 2023 09:59:07 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E6=9C=AC=E5=9C=B0=E5=8C=96=E5=9B=BE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - src/components/Icon/src/Icon.vue | 20 ++++++++++++-------- uno.config.ts | 16 +++++++++++++--- vite.config.ts | 2 +- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 945013f..72d01a0 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ }, "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 008fd8a..4769ec4 100644 --- a/src/components/Icon/src/Icon.vue +++ b/src/components/Icon/src/Icon.vue @@ -3,7 +3,6 @@ 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() @@ -40,20 +39,25 @@ const getIconifyStyle = computed(() => { - + +
diff --git a/uno.config.ts b/uno.config.ts index 383e1c3..2eea413 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -1,4 +1,4 @@ -import { defineConfig, toEscapedSelector as e, presetUno } from 'unocss' +import { defineConfig, toEscapedSelector as e, presetUno, presetIcons } from 'unocss' import transformerVariantGroup from '@unocss/transformer-variant-group' export default defineConfig({ @@ -111,6 +111,16 @@ ${selector}:after { } ] ], - presets: [presetUno({ dark: 'class', attributify: false })], - transformers: [transformerVariantGroup()] + presets: [ + presetUno({ dark: 'class', attributify: false }), + presetIcons({ + prefix: '' + }) + ], + transformers: [transformerVariantGroup()], + content: { + pipeline: { + include: [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html|ts)($|\?)/] + } + } }) diff --git a/vite.config.ts b/vite.config.ts index 16c8541..9a46e50 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -126,7 +126,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { // 拆包 output: { manualChunks: { - vue: ['vue', 'vue-router', 'pinia', 'vue-i18n'], + 'vue-chunks': ['vue', 'vue-router', 'pinia', 'vue-i18n'], 'element-plus': ['element-plus'], 'wang-editor': ['@wangeditor/editor', '@wangeditor/editor-for-vue'], echarts: ['echarts', 'echarts-wordcloud']