Skip to content

Commit

Permalink
resolve bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jun 19, 2017
1 parent 0c8adfa commit de37c6b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/frames/conversation/groupchat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
imgurl,
userId:'',
allgroups:[], //所有群聊信息
}
},
created(){
Expand All @@ -158,6 +159,9 @@
this.gropname=res.petname;
});
socket.on('chat', (data) => {
if (!data) {
return
};
this.groupconversine.push(data);
this.$nextTick(()=>{
window.scrollTo(0,this.$refs.groupHeight.offsetHeight-window.innerHeight)
Expand Down Expand Up @@ -209,7 +213,7 @@
}
this.groupconversine = [...groupData.history, ...this.groupconversine]
console.log(this.groupconversine)
this.allgroups=[...this.groupconversine]
Array.prototype.unique = function(){//数组去重
var res = [this[0]];
Expand Down Expand Up @@ -279,11 +283,10 @@
this.clickmore=false;
},
async clickSend(){
this.light=false;
console.log(this.inputmessage)
socket.emit('chat', {user_id: this.userInfo.id, content: this.inputmessage});
this.inputmessage='';
this.light=false;
this.$nextTick(()=>{
window.scrollTo(0,this.$refs.groupHeight.offsetHeight-window.innerHeight)
})
Expand Down

0 comments on commit de37c6b

Please sign in to comment.