mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
added listener on click enter, chatcomponent - writechatcomponent
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="write">
|
||||
<div class="write__content">
|
||||
<input type="text" v-model.trim="msg" placeholder="Напишите сообщение..." maxlength="22">
|
||||
<input type="text" @keyup.enter="sendmsgDataEnter" v-model.trim="msg" placeholder="Напишите сообщение..." maxlength="22">
|
||||
<button
|
||||
:disabled="CheckerforBtn()"
|
||||
type="submit"
|
||||
@@ -27,6 +27,11 @@ export default {
|
||||
CheckerforBtn() {
|
||||
return this.msg === ''
|
||||
},
|
||||
sendmsgDataEnter() {
|
||||
if (this.msg !== '') {
|
||||
this.SendmsgData()
|
||||
}
|
||||
},
|
||||
SendmsgData() {
|
||||
this.$emit('send', [this.msg, this.username, this.icon])
|
||||
this.msg = ''
|
||||
|
||||
Reference in New Issue
Block a user