mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
added logic for send msg in gamemodes
This commit is contained in:
@@ -108,4 +108,9 @@
|
|||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #3D3F48;
|
background: #3D3F48;
|
||||||
border: none;
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.write__content button:disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,48 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="write">
|
<div class="write">
|
||||||
<div class="write__content">
|
<div class="write__content">
|
||||||
<input type="text" placeholder="Напишите сообщение...">
|
<input type="text" v-model.trim="msg" placeholder="Напишите сообщение...">
|
||||||
<button type="submit"><img src="@/assets/icons-chat/sendmsg-icon.png"></button>
|
<button
|
||||||
|
:disabled="CheckerforBtn()"
|
||||||
|
type="submit"
|
||||||
|
@click="SendmsgData"
|
||||||
|
>
|
||||||
|
<img src="@/assets/icons-chat/sendmsg-icon.png">
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
3
luckydiamond/src/mocks/ChatHistory.js
Normal file
3
luckydiamond/src/mocks/ChatHistory.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export default [
|
||||||
|
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user