你的newData应该和volatilityData保持一致,只改需要改的对象不需要整个forEach一遍// 拷贝一份 const newData = volatilityData.slice(0);你直接把record参数换成下标(如果有下标)// 有下标 newData[index].thresholdValue = text; // 如果没有下标,findIndex去找,同上 // 最后setState newData
你的newData应该和volatilityData保持一致,只改需要改的对象不需要整个forEach一遍
你直接把record参数换成下标(如果有下标)