TIM.EVENT.MESSAGE_RECEIVED
这个事件 收到一条消息会出发很多次
mounted() {
console.log('IM当前会话', this.currentConversation);
console.log('IM当前聊天记录', this.messageList, this.$store.state);
// 收到新消息
this.tim.on(this.TIM.EVENT.MESSAGE_RECEIVED, this.onReceiveMessage)
this.isCompleted = this.$store.state.conversation.isCompleted;
},
onReceiveMessage({ data: messageList }) {
// 没搞清楚为啥可以触发这么多次
console.log('收到消息', messageList);
console.log('已有消息', this.currentMessageList);
this.$store.commit('pushCurrentMessageList', messageList);
this.scrollMessageListToButtom()
},
。
相似问题