Function transferTreeData

  • 转换数组数据为树状数据

    Parameters

    • sourceData: any[]

      源数据

    • options: {
          labelKey: string;
          parentKey: string;
          valueKey: string;
      } = ...

      转化选项

      • labelKey: string
      • parentKey: string
      • valueKey: string

    Returns any[]

    transferTreeData(treeData); /// ...
    transferTreeData(treeData, { labelKey: 'title', valueKey: 'key', parentKey: 'parent' }); /// ...