Skip to content

Commit 36da9e6

Browse files
MajedDHhootlex
authored andcommitted
add events to monitor the requests for slow internet users (#14)
* add fetch event for slow internet users when user have a slow internet connection now he can use fetch & update events to show some "loading" indicator. * add events to monitor the requests
1 parent 59c57d8 commit 36da9e6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

dist/vuejs-paginator.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/VPaginator.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,15 @@ export default {
4646
},
4747
methods: {
4848
fetchData (pageUrl) {
49+
this.$emit("request_start");
4950
pageUrl = pageUrl || this.resource_url
5051
var self = this
5152
this.$http.get(pageUrl, { headers: this.config.headers })
5253
.then(function (response) {
54+
this.$emit("request_finish",response);
5355
self.handleResponseData(response.data)
5456
}).catch(function (response) {
57+
this.$emit("request_error",response);
5558
console.log('Fetching data failed.', response)
5659
})
5760
},

0 commit comments

Comments
 (0)