Heim > Fragen und Antworten > Hauptteil
data= {
"name": "root",
"size": "4",
"Rate": "4",
"level": "3",
"children": [
{
"name": "C1",
"size": "8",
"Rate": "8",
"level": "4",
"children": [
{
"name": "C11",
"size": "8",
"Rate": "8",
"level": "5",
"children":[]
}
]
}
]
}
天蓬老师2017-06-12 09:26:12
js判断??
用hasownproperty('children')封装是否节点含有孩子
然后遍历或者while判断,假如此时没有children,就是最末端,然后去判断就是了