mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
fix: 处理table.column渲染mapping值是 tagSchema 不正常渲染的情况, 避免渲染tag时从 props.value 取值而无法渲染 label
This commit is contained in:
parent
b901ea36fc
commit
c75159b71c
@ -266,22 +266,19 @@ export const MappingField = withStore(props =>
|
||||
label = value[labelField || 'label'];
|
||||
}
|
||||
}
|
||||
let realValue = value;
|
||||
// 处理 table column 渲染 mapping 的值是 tagSchema 不正常渲染的情况
|
||||
if (
|
||||
isObject(label) &&
|
||||
label.type === 'tag' &&
|
||||
!isObject(label.label) &&
|
||||
label.label != null
|
||||
) {
|
||||
realValue = label.label;
|
||||
return render('mapping-tag', label, {
|
||||
// 避免渲染tag时从 props.value 取值而无法渲染 label
|
||||
value: null
|
||||
});
|
||||
}
|
||||
return render('tpl', label, {
|
||||
data: createObject(data, {
|
||||
value: realValue,
|
||||
label: realValue
|
||||
}),
|
||||
...(label?.type === 'tag' ? {value: null} : {})
|
||||
});
|
||||
return render('tpl', label);
|
||||
}
|
||||
return render('mappingItemSchema', itemSchema, {
|
||||
data: createObject(data, isObject(value) ? value : {item: value}),
|
||||
|
Loading…
Reference in New Issue
Block a user