3👍
✅
See nextTick. When you set the message data, you need to wait for Vue to update the DOM. That is what nextTick
is for. Use it pretty much like you’re using setTimeout
axios
.get('/conversation/'+this.conversation.id+'/message')
.then((response) => {
this.messages = response.data;
this.manageHeightChat();
this.$nextTick(this.scrollToEnd.bind(this));
});
Source:stackexchange.com