反应管理员 |如何在 ReferenceField 中连接源 [英] React-admin | How to concat source inside ReferenceField

查看:20
本文介绍了反应管理员 |如何在 ReferenceField 中连接源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表fos_user"和version",我想显示9.0.1.A"而不是/version/1".

I have a table "fos_user" and "version", I would like to display "9.0.1.A" instead of "/ version / 1".

=>fos_userhttps://i.imgur.com/C8f0qor.png

=>版本https://i.imgur.com/HFSKIdz.png

是否可以像这样连接版本"表的字段以在源中显示它?https://i.imgur.com/rxJBmtp.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.

最好的问候,

推荐答案

React-admin |如何在 ReferenceField 中连接源代码?

答案:

<代码><ReferenceField label="Version" source="version" reference="versions"><FunctionField render={version =>`${version.major}.${version.minor}.${version.patch}.${version.letter}`}/></ReferenceField>

这篇关于反应管理员 |如何在 ReferenceField 中连接源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆