akkoma-fe/src/components/chat/chat.js
2017-12-05 11:49:40 +01:00

21 lines
362 B
JavaScript

const chat = {
data () {
return {
currentMessage: '',
channel: null
}
},
computed: {
messages () {
return this.$store.state.chat.messages
}
},
methods: {
submit (message) {
this.$store.state.chat.channel.push('new_msg', {text: message}, 10000)
this.currentMessage = ''
}
}
}
export default chat