下面是vue项目中的部分代码
getTreeIds(data){
if(data.children instanceof Array){
data.children.forEach(item=>{
this.ids.push(item.id);
this.getTreeIds(item)
})
}
}
this.ids.push(data.id);
this.getTreeIds(data);
下面是vue项目中的部分代码
getTreeIds(data){
if(data.children instanceof Array){
data.children.forEach(item=>{
this.ids.push(item.id);
this.getTreeIds(item)
})
}
}
this.ids.push(data.id);
this.getTreeIds(data);