mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 20:29:35 +02:00
added logic for send msg in gamemodes
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user