как при прокрутке скролла вверх в блоке сообщений вызвать метод getMessages()
<ul class="chat--messages__wrapper" v-if="messages.length > 0">
<li class="chat--messages__item" v-for="(message,index) in messages">
<div class="chat--user__image" v-bind:style='{ backgroundImage: `url("/storage/${message.avatar}")` }'></div>
<div class="chat--user__data">
<p class="last--massage" v-html="message.replay"></p>
</div>
</li>
</ul>
export default {
name: "Dialogs",
data: function () {
return {
messages: [],
}
},
created(){
},
watch: {
},
computed: {
},
mounted() {
},
methods: {
getMessage(){
axios.get('/profile/dialogs/messages',{
channels: this.dialogSelect, message:this.message
})
.then((response) => {
this.messages.push(this.email);
//this.dialogs = response.data;
})
.catch(error => {});
},
}
}