This commit is contained in:
shpuld 2018-04-11 00:19:28 +03:00
parent f69a12a912
commit 49aa2d5fb7
2 changed files with 6 additions and 17 deletions

View file

@ -13,7 +13,6 @@ const chatPanel = {
}, },
methods: { methods: {
submit (message) { submit (message) {
console.log(this.currentMessage)
this.$store.state.chat.channel.push('new_msg', {text: message}, 10000) this.$store.state.chat.channel.push('new_msg', {text: message}, 10000)
this.currentMessage = '' this.currentMessage = ''
}, },

View file

@ -24,9 +24,7 @@
</div> </div>
</div> </div>
<div class="chat-input"> <div class="chat-input">
<form @submit.prevent="submit(currentMessage)"> <textarea @keyup.enter="submit(currentMessage)" v-model="currentMessage" class="chat-input-textarea" rows="1"></textarea>
<textarea @keyup.enter="submit(currentMessage)" v-model="currentMessage" class="chat-input-textarea" rows="1"></textarea>
</form>
</div> </div>
</div> </div>
</div> </div>
@ -77,19 +75,11 @@
.chat-input { .chat-input {
display: flex; display: flex;
form { textarea {
flex: auto; flex: 1;
display: flex; margin: 0.6em;
input { min-height: 3.5em;
margin: 0.5em; resize: none;
width: fill-available;
}
textarea {
flex: 1;
margin: 0.6em;
min-height: 3.5em;
resize: none;
}
} }
} }
</style> </style>