Bootstrap-select错误地选择Multi-select

时间:2018-05-22 08:06:25

标签: reactjs bootstrap-select bootstrap-selectpicker

我有什么:

<div className="col-md-2">
    <label>Status</label>
    <select className="selectpicker" multiple title="Choose one of the following...">
        <option>OK</option>
        <option>PENDING</option>
        <option>NEW</option>
    </select>
</div>

问题:

值(OK,PENDING,NEW)在另一个滚动字段中单独显示。而下拉选择字段显示为旁边的单独字段。下拉选择字段内部没有值。附上截图。

Screenshot

我想要的是这种下拉菜单:(取自Bootstrap-select documentation

enter image description here

我项目的技术堆栈:

  • Bootstrap-select 1.13.1
  • Bootstrap 3.x
  • ReactJs

这可能是兼容性问题吗?

修改

我放弃了。我不得不选择使用bootstrap-multiselect。它更不容易混淆。推荐它!

2 个答案:

答案 0 :(得分:0)

is this what you are looking for??
<div className="col-md-2">
    <label>Status</label>
    <select className="selectpicker">
        <option selected="selected">Choose one of the following</option>
        <option>OK</option>
        <option>PENDING</option>
        <option>NEW</option>
    </select>
</div>

答案 1 :(得分:0)

<SideBar onRest={this.changeToRest} test="12" />

1.Here you can pass the test="12" as a props 

2.You can get the props at the sidebar component {this.props.test} like that