tree-elementui

1.0.1 • Public • Published

该module是为了将一位数组转换成elementui中生成树的格式

  • 示例代码
let getTree = require('./index.js')
var tree = [
    { id: 1, parentId: 0, name: "父节点1 - 展开" },
    { id: 11, parentId: 1, name: "父节点11 - 折叠" },
    { id: 12, parentId: 1, name: "父节点12 - 折叠" },
    { id: 13, parentId: 1, name: "父节点13 - 没有子节点" },
    { id: 2, parentId: 0, name: "父节点2 - 折叠" },
    { id: 21, parentId: 2, name: "父节点21 - 展开", },
    { id: 22, parentId: 2, name: "父节点22 - 折叠" },
    { id: 23, parentId: 2, name: "父节点23 - 折叠" },
    { id: 3, parentId: 0, name: "父节点3 - 没有子节点" }
]
let data = getTree(tree)

Readme

Keywords

none

Package Sidebar

Install

npm i tree-elementui

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

8.25 kB

Total Files

5

Last publish

Collaborators

  • equicy