【发布时间】:2019-08-03 17:49:00
【问题描述】:
onRemoveVariant(groupKey, questionKey, variantKey) {
const {questionGroups} = this.props;
questionGroups[groupKey].questions[questionKey].variants.splice(variantKey, 1);
this.props.updateQuestionnaire('questionGroups', questionGroups);
}
我有 5 个变体,当我编辑时,如果我首先使用删除变体或任何其他变体,总是只有最后一个变体得到拼接!
为什么?如果按键拼接不起作用,如何使用拼接?
Img example
【问题讨论】:
-
如果没有看到
render的代码,很难判断,但映射数组时您可能将index指定为key -
是的,关键是索引,当我用数字 0-3 测试时(对我没有帮助)
标签: reactjs