fix(keep-alive): include/exclude should work with async component (#3531)
fix #3529
This commit is contained in:
@@ -36,6 +36,7 @@ import {
|
||||
import { setTransitionHooks } from './BaseTransition'
|
||||
import { ComponentRenderContext } from '../componentPublicInstance'
|
||||
import { devtoolsComponentAdded } from '../devtools'
|
||||
import { isAsyncWrapper } from '../apiAsyncComponent'
|
||||
|
||||
type MatchPattern = string | RegExp | string[] | RegExp[]
|
||||
|
||||
@@ -257,7 +258,15 @@ const KeepAliveImpl: ComponentOptions = {
|
||||
|
||||
let vnode = getInnerChild(rawVNode)
|
||||
const comp = vnode.type as ConcreteComponent
|
||||
const name = getComponentName(comp)
|
||||
|
||||
// for async components, name check should be based in its loaded
|
||||
// inner component if available
|
||||
const name = getComponentName(
|
||||
isAsyncWrapper(vnode)
|
||||
? (vnode.type as ComponentOptions).__asyncResolved || {}
|
||||
: comp
|
||||
)
|
||||
|
||||
const { include, exclude, max } = props
|
||||
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user