Merge pull request #54 from wangji1042/master

fix(IconSelect): 🐛 修复构建时提示iconComponent.name可能为undefined的报错;
This commit is contained in:
Ray Hao
2024-03-08 22:45:43 +08:00
committed by GitHub

View File

@@ -169,7 +169,7 @@ function loadIcons() {
type IconNames = keyof typeof ElementPlusIconsVue; type IconNames = keyof typeof ElementPlusIconsVue;
const renderIcon = (iconName: string) => { const renderIcon = (iconName: string) => {
const iconComponent = ElementPlusIconsVue[iconName as IconNames]; const iconComponent = ElementPlusIconsVue[iconName as IconNames];
if (iconComponent) { if (iconComponent && iconComponent.name) {
return h(resolveComponent(iconComponent.name)); return h(resolveComponent(iconComponent.name));
} }
return null; return null;