ElementUI
label 为空的不展示
将children设为undefined
dg(list) {
list.forEach(item => {
item.label = item.name
item.value = item.id
item.children = item.childrenList.length !== 0 ? item.childrenList : undefined
if (item.children) {
this.dg(item.children)
}
})
},
第一层不展示checkbox复选框
<el-cascader
popper-class="device_cascader"
:options="options"
:props="props"
clearable
></el-cascader>
<style lang="scss" scoped>
</style>
<style lang="scss">
.device_cascader {
.el-cascader-panel {
.el-scrollbar:first-child {
.el-checkbox {
display: none;
}
}
}
}
</style>