Only number 0-9 could inside []:
var index = e.currentTarget.dataset.index;
if(this.data.slideDown[index]==‘hidden’){
this.setData({‘slideDown[index]’:‘show’})
}else{
this.setData({ ‘slideDown[index]’: ‘hidden’ })
}
代码如上,index改成0到9就可以,这是为何,有啥解决办法吗