fix(IconSelect): 🐛 修复构建时提示iconComponent.name可能为undefined的报错;

This commit is contained in:
汪继 2024-03-08 20:52:15 +08:00
parent cc71a453f8
commit 01bc58ba0d
1 changed files with 1 additions and 1 deletions

View File

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