feat: modified how the message is sent. Took out the handleEnter function since it wasnt needed.
This commit is contained in:
parent
64c7f34f41
commit
e83a26d455
|
|
@ -28,3 +28,4 @@ $negative: #e6364b;
|
|||
$info: #6bb9e7;
|
||||
$warning: #e4a944;
|
||||
$white: white;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,14 +27,14 @@ const sendMessage = async () => {
|
|||
text.value = '';
|
||||
}
|
||||
|
||||
const handleEnter = async (e: KeyboardEvent) => {
|
||||
if (e.shiftKey) {
|
||||
text.value += '\n';
|
||||
} else {
|
||||
e.preventDefault();
|
||||
await sendMessage();
|
||||
}
|
||||
};
|
||||
// const handleEnter = async (e: KeyboardEvent) => {
|
||||
// if (e.shiftKey) {
|
||||
// text.value += '\n';
|
||||
// } else {
|
||||
// e.preventDefault();
|
||||
// await sendMessage();
|
||||
// }
|
||||
// };
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -44,12 +44,12 @@ const handleEnter = async (e: KeyboardEvent) => {
|
|||
<div class="chat-body">
|
||||
<DialogueContent :messages="messages"></DialogueContent>
|
||||
</div>
|
||||
<q-form @submit="sendMessage" class="row chat-footer">
|
||||
<q-form class="row chat-footer">
|
||||
<q-input v-model="text" label="Enter a Message" autogrow class="col" style="margin-right: 5px;"
|
||||
@keydown.enter="handleEnter" />
|
||||
<q-btn type="submit" :ripple="{ center: true }" color="primary" glossy label="Send"
|
||||
@keydown.enter="sendMessage" />
|
||||
<!-- <q-btn type="submit" :ripple="{ center: true }" color="primary" glossy label="Send"
|
||||
style="align-self: flex-end; width:60px; height:45px; margin-top: 8px; font-size: 14px;" class="col-2">
|
||||
</q-btn>
|
||||
</q-btn> -->
|
||||
</q-form>
|
||||
</div>
|
||||
</transition>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
|
||||
|
||||
defineProps<{
|
||||
text: string;
|
||||
sent: boolean;
|
||||
|
|
@ -7,6 +8,8 @@ defineProps<{
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<q-chat-message :sent="sent" :text="[text]">
|
||||
<q-chat-message :sent="sent" :text="[text]" :bg-color="!sent ? 'secondary' : 'accent'">
|
||||
</q-chat-message>
|
||||
</template>
|
||||
|
||||
<style></style>
|
||||
Loading…
Reference in New Issue
Block a user