File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 7272 isLoading: false ,
7373 isComplete: false ,
7474 isFirstLoad: true , // save the current loading whether it is the first loading
75+ debounceTimer: null ,
76+ debounceDuration: 100 ,
7577 };
7678 },
7779 computed: {
112114 mounted () {
113115 this .scrollParent = getScrollParent (this .$el );
114116
115- this .scrollHandler = function scrollHandlerOriginal () {
117+ this .scrollHandler = function scrollHandlerOriginal (ev ) {
116118 if (! this .isLoading ) {
117- this .attemptLoad ();
119+ clearTimeout (this .debounceTimer );
120+
121+ if (typeof ev === ' object' && ev .constructor === Event ) {
122+ this .debounceTimer = setTimeout (this .attemptLoad , this .debounceDuration );
123+ } else {
124+ this .attemptLoad ();
125+ }
118126 }
119127 }.bind (this );
120128
You can’t perform that action at this time.
0 commit comments