Skip to content

Commit

Permalink
fix(components): keepalive child disappearing, closes #1615
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Nov 25, 2021
1 parent 800e190 commit 54b2be8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/app-backend-vue3/src/components/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,8 @@ export class ComponentWalker {
tags: [],
}

const isKeepAliveChild = parents.some(parent => parent.type.__isKeepAlive)

// capture children
if (isKeepAliveChild || depth < this.maxDepth) {
if (depth < this.maxDepth || instance.type.__isKeepAlive || parents.some(parent => parent.type.__isKeepAlive)) {
treeNode.children = await Promise.all(children
.map((child, index, list) => this.capture(child, list, depth + 1))
.filter(Boolean))
Expand Down

0 comments on commit 54b2be8

Please sign in to comment.