Skip to content

Commit 22a8c92

Browse files
authored
If there is no parent node, set "true" which appears after the filter
1 parent 0f90bda commit 22a8c92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Tree/Tree.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ export default {
172172
filter (keyWord) {
173173
this.hasSearchResult = false
174174
const walk = (node = this.root) => {
175-
const { children } = node
175+
const { parent, children } = node
176176
children && children.forEach(child => {
177177
if (!keyWord) {
178-
Object.assign(child.data, { visible: true })
178+
Object.assign(child.data, { visible: !parent })
179179
walk(child)
180180
return
181181
}

0 commit comments

Comments
 (0)