Answer the question
In order to leave comments, you need to log in
How to load data from Axios correctly?
Hello.
I am using this construct:
getImageList: function () {
axios
get('https://picsum.photos/v2/list?', {
params: {
page: this.page++,
limit: this.pageSize,
}
})
.then(response => (this.info.push = response.data));
}
<div v-for="infos in info" :key="infos.id">
<img :src="infos.download_url" width="600"><br><br>
</div>
Answer the question
In order to leave comments, you need to log in
This overwrites the past data with new ones
. So it is logical that you do not need to replace the array, but add new elements to it, i.e.this.info.push.push(response.data)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question