From 72be8f536fc57eb0e3fb574a087f2aabc2b842d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=BD=E5=A4=9A=E5=A4=A7=E7=B1=B3?= Date: Tue, 17 Aug 2021 16:10:05 +0800 Subject: [PATCH] Cascader: optimize performance (#21231) --- packages/cascader/src/cascader.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/cascader/src/cascader.vue b/packages/cascader/src/cascader.vue index 29e504df..25e0ff6b 100644 --- a/packages/cascader/src/cascader.vue +++ b/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(); + } } },