enhanceSection: function(child) {
var selectedId = this.state.selected,
答案 0 :(得分:0)
如果我正确理解了您的问题,如果您在已经打开的情况下点击该部分,则需要关闭该部分?
如果是这样,我将这个if语句添加到你的onSelect-function:
onSelect: function(id) {
if (this.state.selected === id) {
this.setState({selected: ""});
} else {
this.setState({selected: id});
}
}