<template>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Тестовый Vue + Laravel</div>
<div class="card-body">
<div v-for="info in infos" :key="info.id">
<img :src="info.download_url" width="200"><br><br>
</div>
<scroll-loader :loader-method="getImageList">
</scroll-loader>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
infos: [],
page: 3,
pageSize: 5,
};
},
methods: {
getImageList: function () {
axios
.get('https://picsum.photos/v2/list?', {
params: {
page: this.page++,
limit: this.pageSize,
}
})
.then(response => (this.infos.concat(response.data)));
},
},
}
</script>
data() {
return {
info: [],
page: 3,
pageSize: 5,
};
}