Merge pull request #54 from wangji1042/master
fix(IconSelect): 🐛 修复构建时提示iconComponent.name可能为undefined的报错;
This commit is contained in:
commit
e9b13ab327
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue