数组格式:
var list = [{
name:"anna",
status:10,
children:[
{name:"bill",status:10},
],
},{
name:"jxk",
status:20,
children:[{
name:"Lilith",
status:10,
children:[{
name:"Miya",
status:10,
}]
}]
}]
fib(val){
let list = val.map((item)=>{
if(item.children){
this.fib(item.children)
}
item.status == 10 ? item.status = "开心" : item.status = "不开心"
return item
})
return list
}
04-02
817
10-20
2491
06-18
159
06-08
4944
10-12
5286
11-02
5641