bootstrap-select是一个简单易于使用的下拉框组件
官方demo:Examples | bootstrap-select · SnapAppointments Developer
安装:
npm i bootstrap-select@1.13.14
以下给出一个实例:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>bootstrap-select</title>
<link rel="stylesheet" href="https://www.52dixiaowo.com/tools/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://www.52dixiaowo.com/tools/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">
<script src="https://www.52dixiaowo.com/tools/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script src="https://www.52dixiaowo.com/tools/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>
<script src="https://www.52dixiaowo.com/tools/npm/bootstrap-select@1.13.14/dist/js/bootstrap-select.min.js"></script>
</head>
<body>
<div class="container">
<h2>Bootstrap-select案例</h2>
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<select class="selectpicker" data-live-search="true" data-size="5" title="请选择语言" data-width="auto">
<option>java</option>
<option>C++</option>
<option>中文</option>
<option>English</option>
<option>PHP</option>
<option>Golang</option>
<option>Python</option>
<option>JavaScript</option>
</select>
</div>
</div>
</div>
</div>
</body>
</html>
本篇完,还有疑问?留下评论吧