当前位置:网站首页>JS tile data lookup leaf node

JS tile data lookup leaf node

2022-07-04 15:14:00 spring-java

Go straight to the code

function chooseLeafNode(id,parentId,list=[]){
	let treeData=[]
	for(let i=0;i<list.length;i++){
		let isLeavel=true
		for(let j=0;j<list.length;j++){
			if(list[i][id]==list[j][id]){
				continue
			}
			if(list[i][id]==list[j][parentId]){
				isLeavel=false
				break
			}
		}
		if(isLeavel){
			treeData.push(list[i])
		}
	}
	return treeData
}
原网站

版权声明
本文为[spring-java]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041359512919.html