传递整个选定的对象数据on Change
let arr=[{name:'trtr', ID:5}, {name:'FGF', ID:8},{name:'adaf', ID:4}, {name:'tyhrf', ID:7}]
<Select size="small"
placeholder="Select..."
allowClear
showSearch
onChange={(name) => this.filterGroupRecord(Group)}
value={this.state.arrselected}
dropdownMatchSelectWidth={false}
style={{ width: 250, marginLeft: 8, marginRight: 8 }}
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}>
{arr && this.arr.map((dd) => dd.name && <Select.Option value={dd.name}>{dd.name}</Select.Option>)}
</Select>
我想在Onchange中传递选定的名称和整个对象。但这只会得到名字。如何传递整个选定的对象数据?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将ARR对象作为字符串值传递为选项值中的字符串值,您可以找到一个工作示例在这里
you can pass arr object as a string value in the option value you can find a working example here
我希望这会有所帮助,您也可以在此链接
I hope this would be helpful, also you can see the example on this link