mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 03:58:05 +08:00
fix: opt group label (#3868)
This commit is contained in:
parent
ad3aaec3ca
commit
db2e3599ff
@ -37,17 +37,18 @@ export function convertChildrenToData(
|
||||
props,
|
||||
} = node as VNode & {
|
||||
type: { isSelectOptGroup?: boolean };
|
||||
children: { default?: () => any };
|
||||
children: { default?: () => any; label?: () => any };
|
||||
};
|
||||
|
||||
if (optionOnly || !isSelectOptGroup) {
|
||||
return convertNodeToOption(node);
|
||||
}
|
||||
const child = children && children.default ? children.default() : undefined;
|
||||
const label = props?.label || children.label?.() || key;
|
||||
return {
|
||||
key: `__RC_SELECT_GRP__${key === null ? index : key}__`,
|
||||
label: key,
|
||||
...props,
|
||||
label,
|
||||
options: convertChildrenToData(child || []),
|
||||
} as any;
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user