Skip to content

Commit

Permalink
fix: chat avt
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjme committed Dec 21, 2017
1 parent 91f7ba2 commit 3415a86
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/route/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
<div id="chat-messages" v-on:scroll="handleScroll">
<label>已经到顶端了</label>
<div v-for="msg in msgList" :class="msg.to==to?'message right':'message'" :key="msg.msgId">
<img :src="msg.to == to?currentUser.avt:profile.avt" />
<template v-if="msg.to == to">
<div v-if="currentUser.avt==''?true:false" class="text-avatar-chat floatingImg">{{currentUser.nick.substring(0,1)}}</div>
<img v-if="currentUser.avt==''?false:true" :src="currentUser.avt" class="floatingImg"/>
</template>
<template v-if="msg.to != to">
<div v-if="profile.avt==''?true:false" class="text-avatar-chat floatingImg">{{profile.nick.substring(0,1)}}</div>
<img v-if="profile.avt==''?false:true" :src="profile.avt" class="floatingImg"/>
</template>
<!-- <img :src="msg.to == to?currentUser.avt:profile.avt" /> -->
<div class="bubble">
<template v-if="msg.contentType==='img'">
<img v-preview="msg.content" :src="msg.content" class="img-msg">
Expand Down

0 comments on commit 3415a86

Please sign in to comment.