Function arrayToTree

  • 将数组转换为树形结构

    Type Parameters

    • T extends object

    • C extends string = "children"

    Parameters

    • array: T[]

      待转换的数组

    • Optional id: null | string | number | symbol

      父节点id

    • options: {
          childrenKey?: C;
          idKey?: string;
          pidKey?: string;
      } = ...

      配置项

      • Optional childrenKey?: C
      • Optional idKey?: string
      • Optional pidKey?: string

    Returns T[] | undefined

    树形结构

Generated using TypeDoc