摘要: 使用了两个for循环,为了方便理解,可以理解为父亲找儿子,把儿子写入家族谱 // pid:父id,为0是最顶级数据,其他则对应每项的id,即父.id = 子.pid,则父.children = 子 interface Tree { id: number pid: number name: strin 阅读全文
posted @ 2023-02-20 11:50 chenjinbang 阅读(261) 评论(0) 推荐(0) 编辑