mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
Fix CheckboxGroup initialValue, close #1631
This commit is contained in:
parent
f7c9e64416
commit
d57632ca5b
@ -17,9 +17,9 @@ export default class CheckboxGroup extends React.Component {
|
||||
super(props);
|
||||
let value;
|
||||
if ('value' in props) {
|
||||
value = props.value;
|
||||
value = props.value || [];
|
||||
} else if ('defaultValue' in props) {
|
||||
value = props.defaultValue;
|
||||
value = props.defaultValue || [];
|
||||
}
|
||||
this.state = { value };
|
||||
}
|
||||
|
@ -14,16 +14,11 @@ function onChange(checkedValues) {
|
||||
}
|
||||
|
||||
const plainOptions = ['Apple', 'Pear', 'Orange'];
|
||||
const options = [{
|
||||
label: '苹果',
|
||||
value: 'Apple',
|
||||
}, {
|
||||
label: '梨',
|
||||
value: 'Pear',
|
||||
}, {
|
||||
label: '橘',
|
||||
value: 'Orange',
|
||||
}];
|
||||
const options = [
|
||||
{ label: '苹果', value: 'Apple' },
|
||||
{ label: '梨', value: 'Pear' },
|
||||
{ label: '橘', value: 'Orange' },
|
||||
];
|
||||
const optionsWithDisabled = [
|
||||
{ label: '苹果', value: 'Apple' },
|
||||
{ label: '梨', value: 'Pear' },
|
||||
|
Loading…
Reference in New Issue
Block a user