I am building a mobile app that calls API and render response data received from server.
The template is quite simple
<template>
<!-- template -->
{{#each customers}}
<!-- render each customer -->
{{/each}}
</template>
<script>
return {
methods: {
getData: {
const self = this;
app.request.get('http://example.com/customers').then((res) => {
self.$setState({customers: res.customers});
self.$update();
});
}
},
on: {
pageBeforeIn: function() {
this.getData();
}
}
}
</script>
I need to perform a logic after the page is completely rendered with data received from server (for example, refreshing scroll)
Is there any event that triggers when the page is completed rendered?
$update() returns a promise but it seems to me that the promise is not resolved when the page is finished rendering.