Răsfoiți Sursa

Cascader: optimize performance (#21231)

好多大米 4 ani în urmă
părinte
comite
72be8f536f
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      packages/cascader/src/cascader.vue

+ 4 - 1
packages/cascader/src/cascader.vue

@@ -413,6 +413,7 @@ export default {
     handleDropdownLeave() {
       this.filtering = false;
       this.inputValue = this.presentText;
+      this.doDestroy();
     },
     handleKeyDown(event) {
       switch (event.keyCode) {
@@ -643,7 +644,9 @@ export default {
         const offsetHeight = Math.round(tags.getBoundingClientRect().height);
         const height = Math.max(offsetHeight + 6, inputInitialHeight) + 'px';
         inputInner.style.height = height;
-        this.updatePopper();
+        if (this.dropDownVisible) {
+          this.updatePopper();
+        }
       }
     },