(data)
| 111 | } |
| 112 | |
| 113 | setData(data) { |
| 114 | if (!Array.isArray(data)) { |
| 115 | markNodeData(this, data); |
| 116 | } |
| 117 | |
| 118 | this.data = data; |
| 119 | this.childNodes = []; |
| 120 | |
| 121 | let children; |
| 122 | if (this.level === 0 && this.data instanceof Array) { |
| 123 | children = this.data; |
| 124 | } else { |
| 125 | children = getPropertyFromData(this, 'children') || []; |
| 126 | } |
| 127 | |
| 128 | for (let i = 0, j = children.length; i < j; i++) { |
| 129 | this.insertChild({ data: children[i] }); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | get label() { |
| 134 | return getPropertyFromData(this, 'label'); |
no test coverage detected