乐趣区

Element-UI组件Cascader-级联选择器-最后一级children为0时bug

我的 4 级组织机构,后台返回的数据,最后一层有 children,但是没有数据。Cascader bug,最后一层会显示一个空的面板。
因此只能手动处理,最后一层 children = undefined;

// 4 层组织机构,最后一级 children 数量为零的空旷 bug。let nums = this.organizationList.length;
for(var i = 0; i < nums; i++){for(var i2 = 0; i2 < this.organizationList[i].children.length; i2++){for(var i3 = 0; i3 < this.organizationList[i].children[i2].children.length; i3++){for(var i4 = 0; i4 < this.organizationList[i].children[i2].children[i3].children.length; i4++){if(this.organizationList[i].children[i2].children[i3].children[i4].children <= 0){this.organizationList[i].children[i2].children[i3].children[i4].children = undefined;
        }
      }
    }
  }
}
退出移动版