我正在使用angular 7构建应用,我需要具有多个级别的树选择下拉列表..我尝试使用“ ngx-tree-select” npm程序包,但它只给了我一层等级.. 这是我的代码:
<tree-select name="simpleSelect" [items]="regionsTree" childrenField="areas"
[(ngModel)]="simpleSelected" required=true #simpleSelect="ngModel"
[filterPlaceholder]="FilterPlaceholder" [allowFilter]="ShowFilter"
[disabled]="Disabled" [allowParentSelection]="AllowParentSelection"
expandMode="all">
</tree-select>
<div *ngIf="simpleSelect.errors && (simpleSelect.dirty || simpleSelect.touched)"
class="alert alert-danger">
<div [hidden]="!simpleSelect.errors.required">Simple select is required</div>
</div>
<div style="padding: 20px;">
<nested-select options="vm.populations" placeholder="Search items"
label="Collapsible with Search" collapsible show-selection></nested-select>
</div>
如您所见,我只能在childrenField属性中添加一个孩子 但是我需要能够生多个级别的孩子。 这是我要在下拉列表中呈现的对象的模型,甚至可以使用此包来进行渲染吗?
预先感谢