Allow finish selection on Cascader parent option, close #896

This commit is contained in:
afc163 2016-01-26 16:41:41 +08:00
parent d064e122b3
commit 0c7feaaa1f
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,43 @@
# 选择即改变
- order: 5
这种交互允许只选中父级选项。
---
````jsx
import { Cascader } from 'antd';
const options = [{
value: 'zhejiang',
label: '浙江',
children: [{
value: 'hangzhou',
label: '杭州',
children: [{
value: 'xihu',
label: '西湖',
}],
}],
}, {
value: 'jiangsu',
label: '江苏',
children: [{
value: 'nanjing',
label: '南京',
children: [{
value: 'zhonghuamen',
label: '中华门',
}],
}],
}];
function onChange(value) {
console.log(value);
}
ReactDOM.render(
<Cascader options={options} onChange={onChange} changeOnSelect />
, mountNode);
````

View File

@ -40,7 +40,7 @@
"object-assign": "~4.0.1",
"rc-animate": "~2.0.2",
"rc-calendar": "~5.3.0",
"rc-cascader": "~0.7.0",
"rc-cascader": "~0.8.0",
"rc-checkbox": "~1.2.0",
"rc-collapse": "~1.4.4",
"rc-dialog": "~5.3.1",