onRoleChange = (roleList) => { this.setState({ roleList, }); } const rolel = this.props.userList.roleList.map((val) => { return { label: val.srName, value: val.srId } })const defaultList = this.state.role.map((val) => { return val.srId }) <CheckboxGroup options={rolel} value={defaultList} onChange={()=>this.onRoleChange()}/>
2 回答
吃鸡游戏
TA贡献1829条经验 获得超7个赞
const rolel = this.props.userList.roleList.map((val) => { return { label: val.srName, value: val.srId } })
//rolel [{label:..,value:..},{label:..,value:..}...]
const defaultList = this.state.role.map((val) => { return val.srId })
// rolel 的子项是不存在srId 属性的,被你改为value了
添加回答
举报
0/150
提交
取消