diff --git a/packages/hooks/use-ordered-children/index.ts b/packages/hooks/use-ordered-children/index.ts index fb0d89c993..c5eb478c7e 100644 --- a/packages/hooks/use-ordered-children/index.ts +++ b/packages/hooks/use-ordered-children/index.ts @@ -8,7 +8,7 @@ import { } from 'vue' import { flattedChildren } from '@element-plus/utils' -import type { ComponentInternalInstance, VNode } from 'vue' +import type { Component, ComponentInternalInstance, VNode } from 'vue' type ChildEssential = { uid: number @@ -23,7 +23,7 @@ const getOrderedChildren = ( const nodes = flattedChildren(vm.subTree).filter( (n): n is VNode => isVNode(n) && - (n.type as any)?.name === childComponentName && + (n.type as Component)?.name === childComponentName && !!n.component ) const uids = nodes.map((n) => n.component!.uid)