Skip to content

Commit

Permalink
Update KeepAlive.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 authored May 24, 2024
1 parent 9474f79 commit 09d5712
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/runtime-core/src/components/KeepAlive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,8 @@ const KeepAliveImpl: ComponentOptions = {
// if KeepAlive child is a Suspense, it needs to be cached after Suspense resolves
// avoid caching vnode that not been mounted
if (isSuspense(instance.subTree.type)) {
const cacheKey = pendingCacheKey
queuePostRenderEffect(() => {
cache.set(cacheKey, getInnerChild(instance.subTree))
cache.set(pendingCacheKey!, getInnerChild(instance.subTree))
}, instance.subTree.suspense)
} else {
cache.set(pendingCacheKey, getInnerChild(instance.subTree))
Expand Down

0 comments on commit 09d5712

Please sign in to comment.