问题
I have a table "fos_user" and "version", I would like to display "9.0.1.A" instead of "/ version / 1".
=>fos_user https://i.imgur.com/C8f0qor.png
=>version https://i.imgur.com/HFSKIdz.png
Is it possible to concatenate the fields of the "version" table to display it in the source, like this? https://i.imgur.com/rxJBmtp.png
Because it will prevent me from creating a new field in the "version" table.
Best regards,
回答1:
React-admin | How to concat source inside ReferenceField ?
Answer:
<ReferenceField label="Version" source="version" reference="versions">
<FunctionField render={version => `${version.major}.${version.minor}.${version.patch}.${version.letter}`} />
</ReferenceField>
来源:https://stackoverflow.com/questions/51418951/react-admin-how-to-concat-source-inside-referencefield