Semantic中可搜索的多级下拉列表

时间:2016-10-04 03:27:17

标签: semantic-ui

我正在尝试使用子菜单和搜索框进行下拉菜单。到目前为止,搜索字符串仅适用于第一级菜单,而不会查看第二级菜单项。有没有办法在第一级之外执行搜索? 最小的例子:

HTML:

<div class="ui segment">

<div class="ui search selection dropdown" id="test">
  <span class="text">Search Selection</span>
  <i class="dropdown icon"></i>
  <div class="menu">
    <div class="item">
      <span class="text">Category 1</span>
    </div>
    <div class="item">
      <i class="dropdown icon"></i>
      <span class="text">Category 2</span>
      <div class="menu">
        <div class="item">Item 2A</div>
        <div class="item">Item 2B</div>
        <div class="item">Item 2C</div>
      </div>
    </div>
    <div class="item">
      <i class="dropdown icon"></i>
      <span class="text">Category 3</span>
      <div class="menu">
        <div class="item">Item 3A</div>
        <div class="item">Item 3B</div>
        <div class="item">Item 3C</div>
      </div>
    </div>
  </div>
</div>
</div>

JS:

$('#test')
  .dropdown();

CSS:

.ui.selection.dropdown .menu {
    overflow: visible !important;
}

JSFiddle链接: https://jsfiddle.net/o1aLysve/

0 个答案:

没有答案