labelField 支持

This commit is contained in:
2betop 2020-03-26 16:43:23 +08:00
parent 3056489d87
commit 0454cc2471
2 changed files with 6 additions and 2 deletions

View File

@ -52,6 +52,7 @@ export default class ButtonGroupControl extends React.Component<
disabled,
options,
value,
labelField,
placeholder,
btnClassName,
btnActiveClassName,
@ -76,7 +77,7 @@ export default class ButtonGroupControl extends React.Component<
return render(
`option/${key}`,
{
label: option.label,
label: option[labelField || 'label'],
icon: option.icon,
size: option.size || size,
type: 'button',

View File

@ -10,6 +10,7 @@ export interface RadiosProps extends OptionsControlProps {
placeholder?: any;
columnsCount?: number;
labelClassName?: string;
labelField?: string;
}
export default class RadiosControl extends React.Component<RadiosProps, any> {
@ -61,7 +62,8 @@ export default class RadiosControl extends React.Component<RadiosProps, any> {
columnsCount,
classPrefix,
itemClassName,
labelClassName
labelClassName,
labelField
} = this.props;
return (
@ -75,6 +77,7 @@ export default class RadiosControl extends React.Component<RadiosProps, any> {
extractValue={extractValue!}
delimiter={delimiter!}
labelClassName={labelClassName}
labelField={labelField}
placeholder={placeholder}
options={options}
columnsCount={columnsCount}