From 246da7c872c6038217fa3397fdc417bf48b060ab Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Tue, 2 Jan 2024 19:35:58 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=A2=9E=E5=BC=BA`useRenderIcon`?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=9C=AC=E5=9C=B0`svg`=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ReIcon/src/hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReIcon/src/hooks.ts b/src/components/ReIcon/src/hooks.ts index 6fc355b9d..6bc0142af 100644 --- a/src/components/ReIcon/src/hooks.ts +++ b/src/components/ReIcon/src/hooks.ts @@ -33,7 +33,7 @@ export function useRenderIcon(icon: any, attrs?: iconType): Component { }); } else if (typeof icon === "function" || typeof icon?.render === "function") { // svg - return h(icon, { ...attrs }); + return attrs ? h(icon, { ...attrs }) : icon; } else if (typeof icon === "object") { return defineComponent({ name: "OfflineIcon",