Commit 1d3ecc58 authored by 杨奕's avatar 杨奕 Committed by GitHub

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

parent d537906a
...@@ -192,6 +192,9 @@ export default { ...@@ -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 { ...@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment