极简单,易于扩展的文件树
极简单,易于扩展的文件树
支持两种数据结构
第一种
[{ name: "父节点1 - 展开", open: true, children: [ {name: "父节点11 - 折叠", children: [ {name: "叶子节点111", nid: "nid"}, {name: "叶子节点112",}, {name: "叶子节点113"}, {name: "叶子节点114"} ] }]
第二种
[ {id: 1, pId: 0, name: "父节点1 - 展开", open: true}, {id: 11, pId: 1, name: "父节点11 - 折叠"}, {id: 111, pId: 11, name: "叶子节点111"}, {id: 112, pId: 11, name: "叶子节点112"}, {id: 113, pId: 11, name: "叶子节点113"}, {id: 114, pId: 11, name: "叶子节点114"}, {id: 12, pId: 1, name: "父节点12 - 折叠"}, {id: 121, pId: 12, name: "叶子节点121"}, {id: 122, pId: 12, name: "叶子节点122"},]
具体用法
代码简单易懂 可以个性化的自己修改成符合需求的文档树 paintingTree(arr, id)//arr为数据,id为文档树的容器
具体代码
按F12键进行查看 如需协助请联系我 qq:2561179983
原文地址:http://zhifubao.masao.top:8282/assets/tree/index.html