mirror of
https://github.com/KevinMidboe/zoff.git
synced 2026-01-18 23:46:03 +00:00
Chat
This commit is contained in:
33
frontend/components/chat/ChatInput.vue
Normal file
33
frontend/components/chat/ChatInput.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<div class="chat-input">
|
||||
<input v-model="chatInput" type="text" placeholder="Aa.." @keyup.enter="send" />
|
||||
<button @click="send">Send</button>
|
||||
<button @click="requestHelp">Help</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
chatInput: ""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
send: function() {
|
||||
if(this.chatInput == "") {
|
||||
return;
|
||||
}
|
||||
this.$emit("sentMessage", this.chatInput);
|
||||
this.chatInput = "";
|
||||
},
|
||||
requestHelp: function() {
|
||||
console.log("emit for help here");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user