aboutsummaryrefslogtreecommitdiff
path: root/src/components/chat_panel/chat_panel.js
blob: b146c5d9169e75b02ab7efdbb11d628476ec212f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const chatPanel = {
  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 chatPanel