added logic for send msg in gamemodes

This commit is contained in:
Kostya
2023-11-19 15:07:59 +03:00
parent 2a12f9b1cf
commit 3e3e4bf365
3 changed files with 44 additions and 3 deletions

View File

@@ -108,4 +108,9 @@
border-radius: 6px;
background: #3D3F48;
border: none;
cursor: pointer;
}
.write__content button:disabled {
cursor: not-allowed;
}

View File

@@ -1,15 +1,48 @@
<template>
<div class="write">
<div class="write__content">
<input type="text" placeholder="Напишите сообщение...">
<button type="submit"><img src="@/assets/icons-chat/sendmsg-icon.png"></button>
<input type="text" v-model.trim="msg" placeholder="Напишите сообщение...">
<button
:disabled="CheckerforBtn()"
type="submit"
@click="SendmsgData"
>
<img src="@/assets/icons-chat/sendmsg-icon.png">
</button>
</div>
</div>
</template>
<script>
export default {
import ChatHistory from "@/mocks/ChatHistory";
export default {
data() {
return {
msg: '',
username: 'TEST USER',
icon: '@/assets/icon-test/person-icon-chat.png'
}
},
methods: {
CheckerforBtn() {
return this.msg === ''
},
SendmsgData() {
const object = {
msg: this.msg,
username: this.username,
icon: this.icon
}
ChatHistory.push(object)
console.log(ChatHistory)
this.msg = ''
return this.$emit('dataclaim')
}
}
}
</script>

View File

@@ -0,0 +1,3 @@
export default [
]