From 92289e545a62bd28ea336c5d712a05445e0e20ab Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Fri, 26 Jan 2018 15:11:34 +0100 Subject: Move chat to sidebar. --- src/components/chat_panel/chat_panel.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/components/chat_panel/chat_panel.js (limited to 'src/components/chat_panel/chat_panel.js') diff --git a/src/components/chat_panel/chat_panel.js b/src/components/chat_panel/chat_panel.js new file mode 100644 index 00000000..b146c5d9 --- /dev/null +++ b/src/components/chat_panel/chat_panel.js @@ -0,0 +1,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 -- cgit v1.2.3-70-g09d2