Pārlūkot izejas kodu

perf: 增强`useRenderIcon`使用本地`svg`的方式

xiaoxian521 1 gadu atpakaļ
vecāks
revīzija
246da7c872
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/components/ReIcon/src/hooks.ts

+ 1 - 1
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",