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>
|
<template>
|
||||||
<div class="write">
|
<div class="write">
|
||||||
<div class="write__content">
|
<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
|
<button
|
||||||
:disabled="CheckerforBtn()"
|
:disabled="CheckerforBtn()"
|
||||||
type="submit"
|
type="submit"
|
||||||
@@ -27,6 +27,11 @@ export default {
|
|||||||
CheckerforBtn() {
|
CheckerforBtn() {
|
||||||
return this.msg === ''
|
return this.msg === ''
|
||||||
},
|
},
|
||||||
|
sendmsgDataEnter() {
|
||||||
|
if (this.msg !== '') {
|
||||||
|
this.SendmsgData()
|
||||||
|
}
|
||||||
|
},
|
||||||
SendmsgData() {
|
SendmsgData() {
|
||||||
this.$emit('send', [this.msg, this.username, this.icon])
|
this.$emit('send', [this.msg, this.username, this.icon])
|
||||||
this.msg = ''
|
this.msg = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user