From b13758d3e97df45566da5195631353a6ad1f0795 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 22 Dec 2024 17:45:58 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/pages/manage/components/ProjectPanel.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/pages/manage/components/ProjectPanel.vue b/resources/assets/js/pages/manage/components/ProjectPanel.vue index 5d92d51c8..a87f85d95 100644 --- a/resources/assets/js/pages/manage/components/ProjectPanel.vue +++ b/resources/assets/js/pages/manage/components/ProjectPanel.vue @@ -1018,7 +1018,7 @@ export default { this.handleColumnDebounce(); }, windowWidth() { - this.handleColumnDebounce(); + this.handleColumnDebounce(100); }, projectData() { this.sortData = this.getSort(); @@ -1697,7 +1697,14 @@ export default { return style; }, - handleColumnDebounce() { + handleColumnDebounce(wait = 10) { + if (this.columnDebounceWait !== wait) { + this.columnDebounceWait = wait; + if (this.columnDebounceInvoke) { + this.columnDebounceInvoke.cancel(); + this.columnDebounceInvoke = null; + } + } if (!this.columnDebounceInvoke) { this.columnDebounceInvoke = debounce(_ => { this.$nextTick(_ => { @@ -1710,7 +1717,7 @@ export default { break; } }) - }, 10); + }, wait); } this.columnDebounceInvoke(); },