3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
node_modules
|
node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
.idea
|
.idea
|
||||||
coverage
|
coverage
|
||||||
|
package-lock.json
|
@@ -1,5 +1,3 @@
|
|||||||
let nodeId = 1
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tree data struct
|
* Tree data struct
|
||||||
* Created by ayou on 2017/7/20.
|
* Created by ayou on 2017/7/20.
|
||||||
@@ -13,7 +11,7 @@ let nodeId = 1
|
|||||||
const TreeNode = function (data) {
|
const TreeNode = function (data) {
|
||||||
const { id, isLeaf } = data
|
const { id, isLeaf } = data
|
||||||
// this.name = name
|
// this.name = name
|
||||||
this.id = (typeof id === 'undefined') ? ('new' + nodeId++) : id
|
this.id = (typeof id === 'undefined') ? new Date().valueOf() : id
|
||||||
this.parent = null
|
this.parent = null
|
||||||
// this.pid = null
|
// this.pid = null
|
||||||
this.children = null
|
this.children = null
|
||||||
|
Reference in New Issue
Block a user