This commit is contained in:
2026-05-24 05:15:53 +08:00
parent 3bee6aaf18
commit 8351498071
3 changed files with 27 additions and 1 deletions

View File

@@ -14,9 +14,10 @@ export function useButtonSlot(
props: { hideIcon?: boolean; loading?: boolean },
) {
const filterNodes = (nodes: ReactNode): ReactNode => {
// 存储挑出 Slot 后的纯净 children
const filtered: ReactNode[] = [];
Children.forEach(nodes, (child) => {
Children.forEach(nodes, (child: any) => {
if (!isValidElement(child)) {
filtered.push(child);
return;