我使用了Bootstrap制作了一个下拉菜单。
我参考的代码在这里:http://getbootstrap.com/docs/4.0/components/dropdowns/
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
现在我想在下拉列表中添加一个搜索框,这样人们可以输入内容,它会缩短到更合适的下拉列表。我尝试了很多方法,其中一些使用像Select2这样的外部插件,但是它们需要使用