mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:19:01 +08:00
修复 options 中如果数据是对象且有 label 属性时,有可能没选中效果的问题
This commit is contained in:
parent
42807708cb
commit
dad59c6f9e
@ -125,7 +125,12 @@ export const FormItemStore = types
|
|||||||
: value
|
: value
|
||||||
];
|
];
|
||||||
|
|
||||||
if (value && value.hasOwnProperty(self.labelField || 'label')) {
|
// 保留原来的 label 信息,如果原始值中有 label。
|
||||||
|
if (
|
||||||
|
value &&
|
||||||
|
value.hasOwnProperty(self.labelField || 'label') &&
|
||||||
|
!selected[0].hasOwnProperty(self.labelField || 'label')
|
||||||
|
) {
|
||||||
selected[0] = {
|
selected[0] = {
|
||||||
[self.labelField || 'label']: value[self.labelField || 'label'],
|
[self.labelField || 'label']: value[self.labelField || 'label'],
|
||||||
[self.valueField || 'value']: value[self.valueField || 'value']
|
[self.valueField || 'value']: value[self.valueField || 'value']
|
||||||
|
Loading…
Reference in New Issue
Block a user