Answer the question
In order to leave comments, you need to log in
Get VueJs scroll coordinates?
how to call the getMessages() method when scrolling up in the message block
<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 => {});
},
}
}
Answer the question
In order to leave comments, you need to log in
Create a custom directive, in which bind the function that takes the directive to the object on which you will hang the directive, then you get the scrollTop, and you dance from it.
To create a directive, you can refer to the vue documentation, there is a simple example.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question