React bootstrap选择下拉列表

时间:2018-01-18 07:15:52

标签: reactjs react-native react-bootstrap react-select

我正在使用ReactJS和BootStrap,并且无法在事件处理程序中获取我传递的下拉数据。 html不是用选项列表构建的,只有输入字段即将到来。

我的代码如下:

<Reference Include="My.Assembly, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\My.Assembly.1.0.0\lib\Release\My.Assembly.dll</HintPath>
</Reference>

,丢弃数据看起来像

  

DROPDOWNLIST = [           {name:&#34; NAme&#34;,id:1,key:&#34; Key&#34;}];

2 个答案:

答案 0 :(得分:0)

检查您正在使用的窗口小部件的文档 - FormControlInput https://github.com/tkrotoff/react-form-with-constraints

通常onChange回调只获取事件作为输入,您可以从事件中获取值。例如:

  

event.target.value

更多信息:

反应:表格 https://react-bootstrap.github.io/components/forms/

React:处理事件 https://reactjs.org/docs/handling-events.html

答案 1 :(得分:0)

这两种可能性中的任何一种都存在。

您必须将属性 as="select" 添加到 <FormControlInput> 并删除 type 属性,或者将 type="text" 更改为 type="select"