你可以使用React-Admin创建表单来存储信息吗?

huangapple go评论71阅读模式
英文:

Can you create forms to store information with React-Admin?

问题

我正在尝试创建一个表单,用于获取信息,这些信息将仅存储而不显示,使用React-admin。
到目前为止,在react-admin中,我只看到了在要向现有表中添加信息或要编辑信息时使用的表单。是否有一种方式可以使表单首先显示,并且仅用于POST信息?

英文:

I am trying to create a form to get information that will only be stored but not displayed using React-admin.
So far, I have only seen forms in react-admin when you want to add information to an existing table or if you want to edit information. Is there a way to have the form appear as the first thing and only POST information?

答案1

得分: 0

是的,在定义您的资源时,在<Admin>组件下,只需将list属性设置为您的创建表单即可。

<Resource name="my_resource" list={MyCreateComp} />

只要您的资源具有list的值,它就会显示在菜单中。

更多信息请参阅react-admin资源文档

英文:

Yes, when defining your resources under your <Admin> component just set the list prop to be your Create form.

<Resource name="my_resource" list={MyCreateComp} />

As long as your resource has a value for list it will show up in the menu.

More info in the react-admin resource docs

huangapple
  • 本文由 发表于 2020年1月4日 01:03:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/59582480.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定