fix(VFormDesign): findIndex === -1 (#3305)

This commit is contained in:
bowen 2023-11-20 16:56:28 +08:00 committed by GitHub
parent 6c0b857d7d
commit d7472b8a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1122,13 +1122,11 @@ export const baseComponentAttrs: IBaseComponentProps = componentAttrs;
//在所有的选项中查找需要配置项 //在所有的选项中查找需要配置项
const findCompoentProps = (props, name) => { const findCompoentProps = (props, name) => {
const idx = props.findIndex((value: BaseFormAttrs, _index) => { const idx = props.findIndex((value: BaseFormAttrs) => {
return value.name == name; return value.name === name;
}); });
if (idx) { if (props[idx] && props[idx].componentProps) {
if (props[idx].componentProps) { return props[idx].componentProps;
return props[idx].componentProps;
}
} }
}; };