From 26b85b5c92c58fc74f25ec6b852ce36cc1445554 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Sun, 31 Jul 2022 19:17:46 +0800 Subject: [PATCH] fix: svg icon --- src/components/ReIcon/src/hooks.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ReIcon/src/hooks.ts b/src/components/ReIcon/src/hooks.ts index 1a215a761..65c41344c 100644 --- a/src/components/ReIcon/src/hooks.ts +++ b/src/components/ReIcon/src/hooks.ts @@ -4,11 +4,11 @@ import { IconifyIconOnline, IconifyIconOffline, FontIcon } from "../index"; /** * 支持fontawesome4、5+、iconfont、remixicon、element-plus的icons、自定义svg - * @param icon 必传 string 图标 + * @param icon 必传 图标 * @param attrs 可选 iconType 属性 * @returns Component */ -export function useRenderIcon(icon: string, attrs?: iconType): Component { +export function useRenderIcon(icon: any, attrs?: iconType): Component { // iconfont const ifReg = /^IF-/; // typeof icon === "function" 属于SVG @@ -30,7 +30,7 @@ export function useRenderIcon(icon: string, attrs?: iconType): Component { }); } }); - } else if (typeof icon === "function") { + } else if (typeof icon === "function" || typeof icon?.render === "function") { // svg return icon; } else {