fix shoutbox header, use custom scroll-to-bottom system, remove vue-chat-scroll, temporarily add chat test hack
This commit is contained in:
parent
30057a4944
commit
0673511fc2
7 changed files with 42 additions and 13 deletions
|
@ -18,6 +18,25 @@ const chat = {
|
|||
actions: {
|
||||
initializeChat (store, socket) {
|
||||
const channel = socket.channel('chat:public')
|
||||
let id = 0
|
||||
const createmsg = () => {
|
||||
id += 1
|
||||
return {
|
||||
text: 'test' + id,
|
||||
author: {
|
||||
username: 'test',
|
||||
avatar: '',
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const loop = () => {
|
||||
store.commit('addMessage', createmsg())
|
||||
setTimeout(loop, 3000)
|
||||
}
|
||||
loop()
|
||||
|
||||
channel.on('new_msg', (msg) => {
|
||||
store.commit('addMessage', msg)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue