react setState方法key设置变量跟获取

1、设置state变量的值

this.setstate({

   [`fileList${index}`]:index

})

2、获取state变量的值
this.state[`fileList${index}`]

评论

暂无评论