id = 0
test(data){
if(data.length !=0){
data.forEach(it=>{
it['key'] == this.id;
this.id++;
it.children = it.list || it.roomList;
this.test(it.children);
})
}
return
}
循环之后,key的值都是1,为什么呢?
写错了吧 应该一个=