简体   繁体   English

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

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

I am trying to create a form to get information that will only be stored but not displayed using React-admin.我正在尝试创建一个表单来获取只会存储但不会使用 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.到目前为止,我只在 react-admin 中看到过当您想向现有表添加信息或编辑信息时的表单。 Is there a way to have the form appear as the first thing and only POST information?有没有办法让表单显示为第一件事并且只显示 POST 信息?

Yes, when defining your resources under your <Admin> component just set the list prop to be your Create form.是的,在<Admin>组件下定义资源时,只需将list属性设置为您的 Create 表单。

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

As long as your resource has a value for list it will show up in the menu.只要您的资源具有 list 值,它就会显示在菜单中。

More info in the react-admin resource docs react-admin 资源文档中的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM