mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 20:09:08 +08:00
transfer的searchApi 返回值判断调整
This commit is contained in:
parent
4396c4424a
commit
314ffb7ef5
@ -105,12 +105,11 @@ export class BaseTransferRenderer<
|
||||
|
||||
return result.map(item => {
|
||||
let resolved: any = null;
|
||||
const value = item[valueField || 'value'];
|
||||
|
||||
if (Array.isArray(options)) {
|
||||
resolved = find(
|
||||
options,
|
||||
optionValueCompare(item[valueField || 'value'], valueField)
|
||||
);
|
||||
// 只有 value 值有意义的时候,再去找;否则直接返回
|
||||
if (Array.isArray(options) && value !== null && value !== undefined) {
|
||||
resolved = find(options, optionValueCompare(value, valueField));
|
||||
}
|
||||
|
||||
return resolved || item;
|
||||
|
Loading…
Reference in New Issue
Block a user