2018-01-26 06:11:34 -08:00
|
|
|
const chatPanel = {
|
2017-12-05 02:02:41 -08:00
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
currentMessage: '',
|
|
|
|
channel: null
|
|
|
|
}
|
|
|
|
},
|
2017-12-05 02:47:10 -08:00
|
|
|
computed: {
|
|
|
|
messages () {
|
|
|
|
return this.$store.state.chat.messages
|
|
|
|
}
|
2017-12-05 02:02:41 -08:00
|
|
|
},
|
|
|
|
methods: {
|
2017-12-05 02:49:40 -08:00
|
|
|
submit (message) {
|
2017-12-05 02:47:10 -08:00
|
|
|
this.$store.state.chat.channel.push('new_msg', {text: message}, 10000)
|
2017-12-05 02:49:40 -08:00
|
|
|
this.currentMessage = ''
|
2017-12-05 02:02:41 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-26 06:11:34 -08:00
|
|
|
export default chatPanel
|