没解决之前
// An highlighted block
//调用api获取数据
searchLabel() {
this.$axios
.get(this.$api.GET_KNOWLEDGELABEL_GETLABLETREE)
.then((res) => {
this.getTypeList(res.content)
console.log(res)
this.options = res.content
})
},
// 处理数据,判断数据children是否有数据
getTypeList(listData) {
listData.forEach((items) => {
if (items.children.length > 0) {
this.getTypeList(items.children)
} else {
items.children = undefined
}
})
},
解决之后