修复 value2Array bug

This commit is contained in:
2betop 2020-05-13 16:45:44 +08:00
parent a47ba7c603
commit fb63837fe6
1 changed files with 10 additions and 1 deletions

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')