I am writing a message module. It is necessary to make pagination for them when scrolling. when writing new messages, they are uploaded to the end of the page vue.js. if you run a standard pagination after writing the message (s), incorrect loading occurs with the repetition of messages, the array has increased and the pagination pointer is all there. How can this be circumvented?
1 answer
You all the same (in fact) are numbering.
Pass the page parameter when reloading the page and store the current page number in the data component variable.
onScroll(){ let self = this this.$http.get('/comments?page'+self.nextPage).then((response) => { self.nextPage++; }, (response) => { // error callback }); } |