代码之家  ›  专栏  ›  技术社区  ›  Aakash Kumar

Angular2-带有下拉菜单NGbDropDown或简单选择下拉菜单的虚拟滚动条

  •  0
  • Aakash Kumar  · 技术社区  · 6 年前

    有没有简单的选择下拉列表或ngbDropdown的工作方式。这就是代码的外观。

    <virtual-scroll [items]="items" (update)="scrollItems = $event" (end)="fetchMoreRecords($event)">
                  <div class="dropdown-menu" ngbDropdownMenu>
                    <h5 class="dropdown-header">Heading</h5>
                    <div class="dropdown-item" *ngFor="let item of scrollItems">
                        item.itemValue
                    </div>
                  </div>
                </virtual-scroll>
    

    <virtual-scroll [items]="items" (update)="scrollItems = $event" (end)="fetchMoreRecords($event)">
              <select id="selectId" [formControlName]="virtualDropdown" class="custom-select"
                required>
                <option *ngFor="let item of scrollItems" [ngValue]="item.itemValue">
                  item.itemValue
                </option>
              </select>
            </virtual-scroll>
    

    但它似乎不起作用。有什么想法吗?提前谢谢。

    0 回复  |  直到 6 年前