From 8a17fe8178c74fa387ffaa2cf335895fd938c4d5 Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Tue, 22 Jul 2025 03:02:53 +0800 Subject: [PATCH] refactor: improve nodes type for `getOrderedChildren` hook (#21450) perf: improve nodes type for splitter hook --- packages/hooks/use-ordered-children/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)