英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论