fix(keep-alive): fix unmounting late-included components

fix #3648
based on #3650
This commit is contained in:
Evan You
2022-05-12 11:52:54 +08:00
parent 20ed16f68c
commit da49c863a2
2 changed files with 77 additions and 2 deletions

View File

@@ -42,6 +42,7 @@ import { setTransitionHooks } from './BaseTransition'
import { ComponentRenderContext } from '../componentPublicInstance'
import { devtoolsComponentAdded } from '../devtools'
import { isAsyncWrapper } from '../apiAsyncComponent'
import { isSuspense } from './Suspense'
type MatchPattern = string | RegExp | (string | RegExp)[]
@@ -323,7 +324,7 @@ const KeepAliveImpl: ComponentOptions = {
vnode.shapeFlag |= ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE
current = vnode
return rawVNode
return isSuspense(rawVNode.type) ? rawVNode : vnode
}
}
}