Commit 07f78213858cd339b5f0663b61d345a8daabb229

Authored by Aresn
Committed by GitHub
2 parents 903d6598 1a6249ad

Merge pull request #4472 from Happy-Friday/2.0

fix: cascader limitless refresh in hover trigger
Showing 1 changed file with 4 additions and 2 deletions   Show diff stats
src/components/cascader/caspanel.vue
@@ -77,8 +77,10 @@ @@ -77,8 +77,10 @@
77 77
78 // return value back recursion // 向上递归,设置临时选中值(并非真实选中) 78 // return value back recursion // 向上递归,设置临时选中值(并非真实选中)
79 const backItem = this.getBaseItem(item); 79 const backItem = this.getBaseItem(item);
80 - this.tmpItem = backItem;  
81 - this.emitUpdate([backItem]); 80 + if (backItem.label !== this.tmpItem.label || backItem.value !== this.tmpItem.value) {
  81 + this.tmpItem = backItem;
  82 + this.emitUpdate([backItem]);
  83 + }
82 if (item.children && item.children.length){ 84 if (item.children && item.children.length){
83 this.sublist = item.children; 85 this.sublist = item.children;
84 this.dispatch('Cascader', 'on-result-change', { 86 this.dispatch('Cascader', 'on-result-change', {