perf: 优化发消息时有时候出现空白需要滚动才出现内容的情况

This commit is contained in:
kuaifan 2022-07-14 12:58:14 +08:00
parent 26d0d07850
commit 0835e5b069
3 changed files with 34 additions and 22 deletions

View File

@ -62,8 +62,8 @@
</ul> </ul>
</div> </div>
<!--等待--> <!--等待-->
<div v-else-if="msgData.type === 'loading'" class="content-text no-dark-content"> <div v-else-if="msgData.type === 'loading'" class="content-loading">
...... <Loading/>
</div> </div>
<!--未知--> <!--未知-->
<div v-else class="content-unknown">{{$L("未知的消息类型")}}</div> <div v-else class="content-unknown">{{$L("未知的消息类型")}}</div>

View File

@ -934,6 +934,7 @@ export default {
text: typeLoad ? '' : msgText, text: typeLoad ? '' : msgText,
}, },
} }
setTimeout(_ => {
this.tempMsgs.push(tempMsg) this.tempMsgs.push(tempMsg)
this.msgType = '' this.msgType = ''
this.replyActiveId = 0; this.replyActiveId = 0;
@ -954,6 +955,7 @@ export default {
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg) $A.modalError(msg)
}); });
}, 10)
} }
}, },

View File

@ -740,6 +740,16 @@
} }
} }
.content-loading {
display: flex;
.common-loading {
width: 20px;
height: 20px;
margin: 4px;
}
}
.content-unknown { .content-unknown {
text-decoration: underline; text-decoration: underline;
} }