0👍
You need to add ld
to your app data and update it on response from axios:
data: {
message: [],
ld: 0, // default id you want to start it from
},
methods: {
loadmore: function () {
axios.get('http://127.0.0.1:5000/api/products/'+this.ld)
.then(response => {
const messages = ...response.data;
this.message.push(messages);
this.ld = messages.pop().id;
});
}
}
Source:stackexchange.com