mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 11:26:24 +00:00
fix: bug
This commit is contained in:
parent
8fb099f5b6
commit
899031e239
@ -74,9 +74,12 @@ export const CollectionFieldInternalFieldV2: React.FC = (props: Props) => {
|
||||
const targetCollection = getCollection(collectionField?.target);
|
||||
let fieldNames = {};
|
||||
if (collectionField?.target && targetCollection) {
|
||||
const initField = collectionField?.targetKey || targetCollection.getPrimaryKey();
|
||||
fieldNames = {
|
||||
label: collectionField?.targetKey || targetCollection.getPrimaryKey(),
|
||||
value: collectionField?.targetKey || targetCollection.getPrimaryKey(),
|
||||
label: targetCollection.getFields()?.find((v) => v.name === field.componentProps.fieldNames?.label)
|
||||
? field.componentProps.fieldNames?.label
|
||||
: initField,
|
||||
value: initField,
|
||||
};
|
||||
}
|
||||
const componentProps = merge(originalProps, { ...(field.componentProps || {}), fieldNames });
|
||||
|
Loading…
Reference in New Issue
Block a user