Skip to content

Instantly share code, notes, and snippets.

@erikfig
Created December 23, 2018 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikfig/422fbc7ab45d531d94e347c1eda2a287 to your computer and use it in GitHub Desktop.
Save erikfig/422fbc7ab45d531d94e347c1eda2a287 to your computer and use it in GitHub Desktop.
<infinite-scroll src="http://localhost:8000/users?page=" pagination-box=".paginated-items"></infinite-scroll>
// restante do arquivo
props: {
paginationBox: {
required: true
},
src: {
default: ''
},
margin: {
default: 0
}
},
// restante do arquivo
getMore() {
this.currentPage++;
this.onLoad = true;
this.load(this.src + '?page=' + this.currentPage, this.paginationBox).then((data) => {
const item = document.querySelector(this.paginationBox);
item.innerHTML += data;
this.onLoad = false;
});
},
// restante do arquivo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment