Commit 55649319b58e516a2f8af5edeccf79452eff8f1f
1 parent
5be1b3ee
fix #4998 , ref #4472
由于 #4472 的 pr,导致了 #5021 和 #4998 的bug
Showing
1 changed file
with
7 additions
and
5 deletions
Show diff stats
src/components/cascader/caspanel.vue
... | ... | @@ -77,14 +77,16 @@ |
77 | 77 | |
78 | 78 | // return value back recursion // 向上递归,设置临时选中值(并非真实选中) |
79 | 79 | const backItem = this.getBaseItem(item); |
80 | - // #5021 | |
81 | - if (this.changeOnSelect) { | |
82 | - this.tmpItem = backItem; | |
83 | - this.emitUpdate([backItem]); | |
84 | - } else if (backItem.label !== this.tmpItem.label || backItem.value !== this.tmpItem.value) { | |
80 | + // #5021 for this.changeOnSelect,加 if 是因为 #4472 | |
81 | + if ( | |
82 | + this.changeOnSelect || | |
83 | + (backItem.label !== this.tmpItem.label || backItem.value !== this.tmpItem.value) || | |
84 | + (backItem.label === this.tmpItem.label && backItem.value === this.tmpItem.value) | |
85 | + ) { | |
85 | 86 | this.tmpItem = backItem; |
86 | 87 | this.emitUpdate([backItem]); |
87 | 88 | } |
89 | + | |
88 | 90 | if (item.children && item.children.length){ |
89 | 91 | this.sublist = item.children; |
90 | 92 | this.dispatch('Cascader', 'on-result-change', { | ... | ... |