我在这里遇到无限滚动的问题。问题是,当我不断滚动时,它会重复相同的数据。我希望它在显示数组的所有数据时不再显示更多数据。有什么办法解决这个问题?这是我的功能:
loadMore: function() {
this.busy = true;
const payload = {
id: this.$route.params.threadID
}
setTimeout(() => {
this.$store.dispatch('getForumThread', payload).then(data => {
data.replies.forEach(element => {
this.replies.push(element);
});
});
console.log(this.data)
this.busy = false;
}, 1000);
}