Skip to content

Commit

Permalink
perf: 优化任务面板
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Dec 22, 2024
1 parent 14775e2 commit b13758d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions resources/assets/js/pages/manage/components/ProjectPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ export default {
this.handleColumnDebounce();
},
windowWidth() {
this.handleColumnDebounce();
this.handleColumnDebounce(100);
},
projectData() {
this.sortData = this.getSort();
Expand Down Expand Up @@ -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(_ => {
Expand All @@ -1710,7 +1717,7 @@ export default {
break;
}
})
}, 10);
}, wait);
}
this.columnDebounceInvoke();
},
Expand Down

0 comments on commit b13758d

Please sign in to comment.