Blogger Information
Blog 53
fans 3
comment 0
visits 55273
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
20200208-超级好用layui下拉框秒变搜索框,自动匹配
邯郸易住宋至刚
Original
5576 people have browsed it

layui下拉框提供了便利的选项

一、下拉框存在的问题

下拉框提供了精准和选项,但是当选项增加到一定数量时,找到精准的选项就成为了一个较为棘手的问题了。

二、解决办法

为了解决这个问题,layui为我们解决了如下解决方案,只需要在select标签中添加lay-search,马上就变成了输入框,在输入框内输入搜索内容,会自动匹配该输入内容。

三、代码

  1. <div class="layui-form-item">
  2. <label class="layui-form-label">选择框</label>
  3. <div class="layui-input-block">
  4. <select name="city" lay-verify="required" **lay-search**>
  5. <option value=""></option>
  6. <option value="0">北京</option>
  7. <option value="1">上海</option>
  8. <option value="2">广州</option>
  9. <option value="3">深圳</option>
  10. <option value="4">杭州</option>
  11. </select>
  12. </div>
  13. </div>

四、结果

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments