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

This commit is contained in:
xiaoxian521 2024-01-02 19:35:58 +08:00
parent ba1f655b6e
commit 246da7c872

View File

@ -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",