This commit is contained in:
Zhiyuan Guo
2018-12-08 11:53:36 +08:00
parent 7bc8a7a17f
commit 572b045314
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