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
commit e9b13ab327
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

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;