Add boolean to CheckboxValueType

Close #10677
This commit is contained in:
Wei Zhu 2018-06-09 14:39:42 +08:00
parent 05c5115991
commit 1a9456f03a

View File

@ -4,7 +4,7 @@ import classNames from 'classnames';
import shallowEqual from 'shallowequal';
import Checkbox from './Checkbox';
export type CheckboxValueType = string | number;
export type CheckboxValueType = string | number | boolean;
export interface CheckboxOptionType {
label: string;
@ -121,7 +121,7 @@ export default class CheckboxGroup extends React.Component<CheckboxGroupProps, C
children = this.getOptions().map(option => (
<Checkbox
prefixCls={prefixCls}
key={option.value}
key={option.value.toString()}
disabled={'disabled' in option ? option.disabled : props.disabled}
value={option.value}
checked={state.value.indexOf(option.value) !== -1}