【文件属性】:
文件名称:tree-util:用于处理n元树的库
文件大小:71KB
文件格式:ZIP
更新时间:2021-05-09 08:06:38
JavaScript
树实用
一个用于处理n元树的库。
安装
npm i @djyde/tree-util
用法
import TreeNode from '@djyde/tree-util'
// or commonjs
const TreeNode = require ( '@djyde/tree-util' ) . default
const root = new TreeNode ( {
// id is required and should be unique
id : 'root'
} , [
new TreeNode ( { id : 'foo' } ) ,
new TreeNode ( { id : 'bar' } ) ,
] )
// append a child in the node which id is equal to `foo`
root . appendChil
【文件预览】:
tree-util-master
----.travis.yml(33B)
----package.json(446B)
----test()
--------insertBefore.test.js(1KB)
--------appendTo.test.js(1KB)
--------appendChild.test.js(845B)
--------prependTo.test.js(1KB)
--------fromJson.test.js(496B)
--------insertAfter.test.js(1KB)
--------findParent.test.js(762B)
--------remove.test.js(1007B)
--------copy.test.js(2KB)
--------exchange.test.js(942B)
----src()
--------utils.ts(293B)
--------index.ts(3KB)
----tsconfig.json(231B)
----.gitignore(3KB)
----README.md(2KB)
----yarn.lock(158KB)