问题描述
我正在使用一种表格为用户获取位置,但是如果用户希望添加多个位置,我想添加此表格的副本。
我正在使用template by ShareTribe,正在使用的组件是EditListingLocationPanel found here。
表单使用 react-final-form ,而我的updatedValues
当前是这样的
publicData: {
places: [
{
name,geolocation: {
lat: origin.lat,lng: origin.lng
},address: {
country: locationCountry,street: locationStreet,city: locationCity,area: locationArea,postal: locationPostal
}
}
],},
我的问题是
如何复制表格并将此新输入字段作为新索引添加到places
数组中,而不是替换已经存在的值?
因此,基本上我想在 places [0] 上占有一席之地,然后在 places 1
上再占有一席之地解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)