From 38155e0a9205a2cdf275807fa4afb85da60e35f7 Mon Sep 17 00:00:00 2001 From: piaobo <1913856125@qq.com> Date: Wed, 9 Jul 2025 14:47:16 +0800 Subject: [PATCH] =?UTF-8?q?element-plus=E5=9B=BE=E6=A0=87=E6=B3=A8?= =?UTF-8?q?=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/main.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 803a3fb..de8e23e 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "url": "https://gitee.com/y_project/RuoYi-Vue.git" }, "dependencies": { - "@element-plus/icons-vue": "2.3.1", + "@element-plus/icons-vue": "^2.3.1", "@vueup/vue-quill": "1.2.0", "@vueuse/core": "10.11.0", "axios": "0.28.1", diff --git a/src/main.js b/src/main.js index 0994583..7533427 100644 --- a/src/main.js +++ b/src/main.js @@ -42,9 +42,16 @@ import ImageUpload from "@/components/ImageUpload" import ImagePreview from "@/components/ImagePreview" // 字典标签组件 import DictTag from '@/components/DictTag' +// element-plus 图标 +import * as ElementPlusIconsVue from '@element-plus/icons-vue' const app = createApp(App) +// 全局注册element-plus的图标 +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component) +} + // 全局方法挂载 app.config.globalProperties.useDict = useDict app.config.globalProperties.download = download