Skip to content

Variables ​

eachTree ​

const eachTree: EachTreeFunc

根据迭代器遍历树列表

Param ​

树列表

Param ​

迭代器

Param ​

配置项

Example ​

ts
eachTree(
  [
    {
      id: 1,
      text: '1',
      children: [
        {
          id: 3,
          text: '3',
        }
      ]
    },
    {
      id: 2,
      text: '2',
    }
  ],
  (node) => console.log(node.text),
)

Interfaces ​

EachTreeOptions ​

Properties ​

PropertyTypeDescription
childrenKey?string子节点键 Default 'children'