优化对话自动滚动到底部

This commit is contained in:
aixianling
2023-05-18 15:38:25 +08:00
parent 1e4be83499
commit 3ba394123e
2 changed files with 10 additions and 10 deletions

View File

@@ -1,12 +1,5 @@
<template>
<section class="chatContent" @scroll="onScroll">
<div class="chat-wrapper">
<div class="chat-friend">
<div class="chat-text">
<v-md-preview :text="demo"/>
</div>
</div>
</div>
<div class="chat-wrapper" v-for="item in list" :key="item.id">
<div class="chat-friend" v-if="item.uid !== 'me'">
<div class="chat-text" v-if="item.chatType == 0">
@@ -74,6 +67,9 @@ export default {
this.isAutoScroll = scrollTop + offsetHeight === scrollHeight;
scrollDom.scrollTop = scrollHeight - scrollDom.clientHeight
},
scrollBottom() {
this.$el.scrollTop = this.$el.scrollHeight - this.$el.clientHeight
},
copy(msg) {
if (copyToClipboard(msg)) {
this.$message.success("已复制")