akkoma-fe/src/components/chat/chat.js

22 lines
363 B
JavaScript
Raw Normal View History

2017-12-05 10:02:41 +00:00
const chat = {
data () {
return {
currentMessage: '',
channel: null
}
},
2017-12-05 10:47:10 +00:00
computed: {
messages () {
return this.$store.state.chat.messages
}
2017-12-05 10:02:41 +00:00
},
methods: {
submit(message) {
2017-12-05 10:47:10 +00:00
this.$store.state.chat.channel.push('new_msg', {text: message}, 10000)
2017-12-05 10:02:41 +00:00
this.currentMessage = '';
}
}
}
export default chat;