我如何跟踪“蚂蚁设计 - 动态形式”项目。并将所有值存储在一个对象状态中?
因此,我使用的是ant Design 您可以创建所需的输入字段。
问题是如何将所有值(静态字段和新字段)
存储在我的状态中的单个数组中?
如果单击单击,请添加它将创建另一个autocompletete和aputfield。例如,您输入数据
,例如,我想要这样的对象,
[{commisionFor: 'Invoicing' , perctange: 10},{newcondition: 'something' , percentage: 32},{} , {} , {] , and etc ]
我想实现这一目标。我该怎么做?我将感谢您的帮助
PS :我不是在这里键入代码,因为这很复杂,我什至不知道自己做了什么。看看这个蚂蚁设计动态表单sandbox
So I'm using Ant Design Dynamic Form Item and you can create as many as input field you want.
the question is how can I store all of the values(static field and new fields)
in a single array of objects
inside my state?
Please take a Look at my component
if you click add it will create another Autocomplete and a inputfield. and you enter data
for example I want an array of object like this
[{commisionFor: 'Invoicing' , perctange: 10},{newcondition: 'something' , percentage: 32},{} , {} , {] , and etc ]
I wanna achieve this. how can i do this ? I will appreciate your help
PS: I'm not typing my code here because it's to complex and I don't even know what i did. Take look at this Ant Design Dynamic Form Item sandbox
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用Onchange事件单独存储所有值。
在您的多个输入字段中,为每个输入字段创建唯一名称。
将自己的属性用于命名字段,或者仅使用索引值。
you can use onChange event to store all values separately.
and in your multiple input field, create unique name for each input field.
use your own attribute for naming fields or just use the index value.