TJ-JSTOOLS ---- 数组工具函数
安装
sh
npm i tj-jstools
1
简单使用
js
import { toTreeData } from "tj-jstools";
console.log(toTreeData)
1
2
2
API-列表
| 序号 | 名称 | 参数 | 功能简介 |
|---|---|---|---|
| 1 | toTreeData | targetArr: any[],options?: treeOption | 将特定数组转为树形结构 |
| 2 | treeToFlat | targetArr: any[],childName?: string | 将树形结构扁平化一维数组 |
| 3 | findTreeData | targetArr: any[],conditions: object,cb?: Function, childName?: string | 查找符合条件的树形节点 |
TIP
点击API名称,可以直接进入对应API详情页面!
TJ-JSTOOLS