Cascader: fix disabled items in filtered results (#11185)

pull/10241/merge
杨奕 2018-05-16 13:18:02 +08:00 committed by GitHub
parent d537906ac6
commit 1d3ecc5820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -192,6 +192,9 @@ export default {
childrenKey() { childrenKey() {
return this.props.children || 'children'; return this.props.children || 'children';
}, },
disabledKey() {
return this.props.disabled || 'disabled';
},
currentLabels() { currentLabels() {
let options = this.options; let options = this.options;
let labels = []; let labels = [];
@ -332,7 +335,8 @@ export default {
return { return {
__IS__FLAT__OPTIONS: true, __IS__FLAT__OPTIONS: true,
value: optionStack.map(item => item[this.valueKey]), value: optionStack.map(item => item[this.valueKey]),
label: this.renderFilteredOptionLabel(value, optionStack) label: this.renderFilteredOptionLabel(value, optionStack),
disabled: optionStack.some(item => item[this.disabledKey])
}; };
}); });
} else { } else {