Merge pull request #17 from ParadeTo/fix-issue#13

fix issue #13
This commit is contained in:
ayou
2018-12-08 22:20:50 +08:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
node_modules
npm-debug.log
.idea
coverage
coverage
package-lock.json

View File

@@ -1,5 +1,3 @@
let nodeId = 1
/**
* Tree data struct
* Created by ayou on 2017/7/20.
@@ -13,7 +11,7 @@ let nodeId = 1
const TreeNode = function (data) {
const { id, isLeaf } = data
// this.name = name
this.id = (typeof id === 'undefined') ? ('new' + nodeId++) : id
this.id = (typeof id === 'undefined') ? new Date().valueOf() : id
this.parent = null
// this.pid = null
this.children = null