@yulu-fe/tree-utils

0.0.2 • Public • Published

@yulu-fe/tree-utils

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

Setup

npm install @yulu-fe/tree-utils --save

Simple usage

import TreeUtils from ' @yulu-fe/tree-utils';

let list = [
  { id: 0, root: 'root' },
  { id: 1, name: 'name1', pid: 0 },
  { id: 2, name: 'name2', pid: 0 },
  { id: 3, name: 'name3', pid: 1 },
  { id: 4, name: 'name4', pid: 3 }
];

let tree = TreeUtils.list2Tree(list, 0);

Readme

Keywords

Package Sidebar

Install

npm i @yulu-fe/tree-utils

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

4.96 kB

Total Files

4

Last publish

Collaborators

  • yanglaowu