mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
Merge pull request #7058 from CheshireJCat/fix-table-column-mapping-render-tag-bug
fix: 处理table.column渲染mapping值是 tagSchema 不正常渲染的情况, 避免渲染tag时从 props.va…
This commit is contained in:
commit
b477a6d122
@ -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