瀏覽代碼

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

杨奕 7 年之前
父節點
當前提交
1d3ecc5820
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      packages/cascader/src/main.vue

+ 5 - 1
packages/cascader/src/main.vue

@@ -192,6 +192,9 @@ export default {
     childrenKey() {
       return this.props.children || 'children';
     },
+    disabledKey() {
+      return this.props.disabled || 'disabled';
+    },
     currentLabels() {
       let options = this.options;
       let labels = [];
@@ -332,7 +335,8 @@ export default {
           return {
             __IS__FLAT__OPTIONS: true,
             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 {