Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
动态表单默认没有item表单渲染时,需要点击+ Add field添加新的item。
item
+ Add field
item当表单第一次呈现时,我希望最初有一个默认值。
Form组件第一次渲染时的 默认值:
Form
当组件第一次呈现时,我想要这样的东西:
item如果fields数组为空,则需要在map数组上为您提供第一个初始对象fields。
fields
map
fields = fields.length === 0 ? [{ name: 0, key: 0, fieldKey: 0 }] : fields;