关于react.js:react-setState方法key设置变量跟获取

2次阅读

共计 101 个字符,预计需要花费 1 分钟才能阅读完成。

1、设置 state 变量的值

this.setstate({

   [`fileList${index}`]:index

})

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

正文完
 0