I am trying to implement Infinite Loading using vue-InfiniteLoading component. I am getting an array everytime I scroll and I try to push the contents from the array to another array when I get the data. When I used push, I see new elements on screen but no images and infomation..
I tried push, concat and foreach, none of them worked for me. response.data.data.data is the array containin new elements and dorms is the main array shown on UI.
I also tried push (...response.data.data.data)
.get(`/site/cities/dorms/istanbul?page=${self.page}`)
.then(response => {
if (response.data.data.data) {
this.page += 1;
// var myArray = self.dorms;
// self.dorms = myArray .concat(response.data.data.data);
// self.dorms.push(response.data.data.data[1]);
/* response.data.data.data.forEach(item => {
self.dorms.push(item);
}); */
self.dorms.push(...response.data.data.data);
//self.dorms = response.data.data.data;
self.popupDorms = response.data.data.popups;
$state.loaded();
} else {
$state.complete();
}
});
I expect all informatin within array pushed but it doesnt work.