需求:用el-tree实现的下拉列表精准查询,点击节点展示该节点下的内容,现在产品要求从后端接口获取的值直接进行过滤展示有内容的节点,没有查询内容的则不展示,树没有父节点,都是平级展示。
<div class="checked-all">
<fin-checkbox v-model="checkAll" :indeterminate="pickStatus == 1" @change="checkedAll"
>全选</fin-checkbox
>
</div>
<fin-tree
ref="appTree"
:data="appLists"
show-checkbox
node-key="id"
:props="defaultProps"
default-expand-all
@check="checkedSingle"
></fin-tree>
getApps().then((res) => {
this.appLists = res.map((item) => ({
label: item.name,
id: item.id,
}));
});
求教各位老师们有啥好的办法吗?