修复 value2Array bug

This commit is contained in:
2betop 2020-05-13 16:45:44 +08:00
parent 599271ce9d
commit ee37d92b5a

View File

@ -107,7 +107,8 @@ export function expandValue(
if (
valueType !== 'string' &&
valueType !== 'number' &&
valueType !== 'boolean'
valueType !== 'boolean' &&
valueType !== 'object'
) {
return value as Option;
}
@ -116,6 +117,14 @@ export function expandValue(
return null;
}
if (
valueType === 'object' &&
value &&
value.hasOwnProperty(valueField || 'value')
) {
value = (value as Option)[valueField || 'value'] || '';
}
return findTree(
options,
optionValueCompare(value, valueField || 'value')