Created
December 23, 2018 14:18
-
-
Save erikfig/422fbc7ab45d531d94e347c1eda2a287 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<infinite-scroll src="http://localhost:8000/users?page=" pagination-box=".paginated-items"></infinite-scroll> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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