RoomChatList.vue
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<template>
<div class="m-chat-main p-room-chat-list">
<chat-list
type="chatroom"
:chatroomId="chatroomId"
:msglist="msglist"
@msgs-loaded="msgsLoaded"
></chat-list>
<chat-editor
type="chatroom"
:chatroomId="chatroomId"
></chat-editor>
</div>
</template>
<script>
import ChatEditor from './components/ChatEditor'
import ChatList from './components/ChatList'
import util from '../utils'
import pageUtil from '../utils/page'
export default {
components: {
ChatEditor,
ChatList
},
// 进入该页面,文档被挂载
mounted () {
// 此时设置当前会话
pageUtil.scrollChatListDown()
},
updated () {
pageUtil.scrollChatListDown()
},
data () {
return {
}
},
computed: {
chatroomId () {
let chatroomId = this.$route.params.chatroomId
return chatroomId
},
msglist () {
let msgs = this.$store.state.currChatroomMsgs
return msgs
}
},
methods: {
msgsLoaded () {
pageUtil.scrollChatListDown()
}
}
}
</script>
<style scoped>
.p-room-chat-list {
.m-chat-editor-main {
.u-editor-input {
padding-right: 8rem;
}
.u-editor-icons {
width: 8rem;
}
}
.u-msg {
.msg-text {
max-width: 80%;
}
.msg-link {
bottom: 0;
right: -4rem;
font-size: 0.9rem;
}
}
}
</style>