The function you gave should be a method in a module, and it needs to be viewed together with other attributes or methods in this module. Just look at this method. This method should exist as a callback function for an event (probably a scroll event). When this event is triggered, this method is executed. There are two situations (1) this.scroll is true and enters the specific logic
(2) this.scroll is false and the above logic is not executed // This code lacks the logic to set this.scroll back to true. I think it is in getAjaxData. The advantage of doing this is that when loading new When the page is scrolling, the listening event is temporarily invalid and will not cause the same request to be issued repeatedly
The function you gave should be a method in a module, and it needs to be viewed together with other attributes or methods in this module.
Just look at this method. This method should exist as a callback function for an event (probably a scroll event). When this event is triggered, this method is executed. There are two situations
(1) this.scroll is true and enters the specific logic
(2) this.scroll is false and the above logic is not executed
// This code lacks the logic to set this.scroll back to true. I think it is in getAjaxData. The advantage of doing this is that when loading new When the page is scrolling, the listening event is temporarily invalid and will not cause the same request to be issued repeatedly
Just scroll to the bottom and there is still 200 distance, start loading the data once, wait for the data rendering to complete, and resume. Recycle
I guess you want to ask why this initial flag is set?
It should be to prevent multiple ajax requests for one scroll.