AntDesign自定义表单列表:如何处理嵌套数组?
创始人
2024-11-07 15:31:21
0次
- 首先,我们需要在Form.List组件中使用renderItem属性来呈现每个项目。在renderItem方法中,我们需要使用index作为key来唯一标识每个嵌套数组中的项目。
{(fields, { add, remove }) => (
<>
{fields.map((field) => (
))}
>
)}
- 在处理嵌套数组时,我们需要使用另一个Form.List组件来循环遍历内
相关内容