mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
joinValues false 报错
This commit is contained in:
parent
83f7a65d7a
commit
40dae339b3
@ -152,7 +152,7 @@ export const FormItemStore = types
|
||||
|
||||
const selectedOptions: Array<any> = [];
|
||||
|
||||
selected.forEach(item => {
|
||||
selected.forEach((item, index) => {
|
||||
const matched = findTree(self.filteredOptions, option => {
|
||||
return isObject(item)
|
||||
? item === option[self.valueField || 'value']
|
||||
@ -161,11 +161,20 @@ export const FormItemStore = types
|
||||
|
||||
if (matched) {
|
||||
selectedOptions.push(matched);
|
||||
} else if (item) {
|
||||
selectedOptions.push({
|
||||
[self.valueField || 'value']: item,
|
||||
[self.labelField || 'label']: item
|
||||
});
|
||||
} else {
|
||||
let unMatched = (value && value[index]) || item;
|
||||
|
||||
if (
|
||||
unMatched &&
|
||||
(typeof unMatched === 'string' || typeof unMatched === 'number')
|
||||
) {
|
||||
unMatched = {
|
||||
[self.valueField || 'value']: item,
|
||||
[self.labelField || 'label']: item
|
||||
};
|
||||
}
|
||||
|
||||
unMatched && selectedOptions.push(unMatched);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user