修改overflow,将overflow调整到最底部
This commit is contained in:
parent
09badc802e
commit
963e5c93e1
|
@ -4,7 +4,7 @@
|
|||
<h1 class="title">聊天室</h1>
|
||||
<hr class="divide">
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="body" id="chat">
|
||||
<div v-for="(message, index) in messageList" :key="index">
|
||||
|
||||
|
||||
|
@ -58,6 +58,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
messageList: [
|
||||
|
@ -120,7 +121,12 @@ export default {
|
|||
textarea: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
var container = document.getElementById('chat');
|
||||
container.scrollTop = container.scrollHeight;
|
||||
},
|
||||
methods: {
|
||||
|
||||
SendMessage(textarea) {
|
||||
//发送消息
|
||||
console.log(textarea);
|
||||
|
@ -154,6 +160,7 @@ export default {
|
|||
}
|
||||
|
||||
.body {
|
||||
// overflow: hidden;
|
||||
overflow: auto;
|
||||
/* 可选:设置最大高度以限制滚动区域 */
|
||||
max-height: 350px;
|
||||
|
|
Loading…
Reference in New Issue