We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad3aaec commit db2e359Copy full SHA for db2e359
components/vc-select/utils/legacyUtil.ts
@@ -37,17 +37,18 @@ export function convertChildrenToData(
37
props,
38
} = node as VNode & {
39
type: { isSelectOptGroup?: boolean };
40
- children: { default?: () => any };
+ children: { default?: () => any; label?: () => any };
41
};
42
43
if (optionOnly || !isSelectOptGroup) {
44
return convertNodeToOption(node);
45
}
46
const child = children && children.default ? children.default() : undefined;
47
+ const label = props?.label || children.label?.() || key;
48
return {
49
key: `__RC_SELECT_GRP__${key === null ? index : key}__`,
- label: key,
50
...props,
51
+ label,
52
options: convertChildrenToData(child || []),
53
} as any;
54
})
0 commit comments