fix Cascader defaultValue

This commit is contained in:
afc163 2016-05-09 11:59:30 +08:00
parent 3e97b393a2
commit 67aa04eb14

View File

@ -21,8 +21,14 @@ export default class Cascader extends React.Component {
constructor(props) {
super(props);
let value;
if ('value' in props) {
value = props.value;
} else if ('defaultValue' in props) {
value = props.defaultValue;
}
this.state = {
value: props.value || props.defaultValue || [],
value: value || [],
popupVisible: false,
};
}