JS 有父子关系的数组转Tree结构函数

function convert(rows){ function exists(rows, parentId){ for(var i=0; i<rows.length; i++){ if (rows[i].id == parentId) return true; } return false; } var nodes = []; // get the top leve
相关文章
相关标签/搜索