优化对话自动滚动到底部
This commit is contained in:
@@ -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("已复制")
|
||||
|
||||
Reference in New Issue
Block a user