mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix: 修改table中的mapping使用tag的时候展示不符合预期的bug (#6395)
Co-authored-by: jinye <jinye@baidu.com>
This commit is contained in:
parent
e07c5562c0
commit
dfb6587b87
@ -262,11 +262,27 @@ export const MappingField = withStore(props =>
|
||||
label = value[labelField || 'label'];
|
||||
}
|
||||
}
|
||||
return render('tpl', label);
|
||||
let realValue = value;
|
||||
if (
|
||||
isObject(label)
|
||||
&& label.type === 'tag'
|
||||
&& !isObject(label.label)
|
||||
&& label.label != null
|
||||
) {
|
||||
realValue = label.label;
|
||||
}
|
||||
return render('tpl', label, {
|
||||
data: createObject(data, {
|
||||
value: realValue,
|
||||
label: realValue
|
||||
}),
|
||||
value: null
|
||||
});
|
||||
}
|
||||
|
||||
return render('mappingItemSchema', itemSchema, {
|
||||
data: createObject(data, isObject(value) ? value : {item: value})
|
||||
data: createObject(data, isObject(value) ? value : {item: value}),
|
||||
// 阻止 itemSchema 从props.value 取值,否则渲染不正确
|
||||
value: null
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user