From 6f90eead85d67894df5fa4177475c606adaddf4c Mon Sep 17 00:00:00 2001 From: AndzejsP Date: Fri, 5 May 2023 12:51:17 +0300 Subject: [PATCH] added loading spinner --- web/src/components/ChatBox.vue | 47 +++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/web/src/components/ChatBox.vue b/web/src/components/ChatBox.vue index aff56d7c..9f5e562b 100644 --- a/web/src/components/ChatBox.vue +++ b/web/src/components/ChatBox.vue @@ -5,16 +5,25 @@
- - + + + Send message + +
+ + +
+
@@ -28,9 +37,19 @@ import feather from 'feather-icons' export default { name: 'ChatBox', emits: ["messageSentEvent"], + props: { + + loading: false + + }, setup() { return {} }, + data() { + return { + message: "" + } + }, methods: { sendMessageEvent(msg) { @@ -43,13 +62,20 @@ export default { console.log("enter detected"); if (!event.repeat) { - this.sendMessageEvent(event.target.value) - event.target.value="" // Clear input field + this.sendMessageEvent(this.message) + this.message = "" // Clear input field } } }, - }, + submit() { + if (this.message) { + this.sendMessageEvent(this.message) + this.message = "" + } + + } + }, mounted() { nextTick(() => { feather.replace() @@ -60,3 +86,6 @@ export default { } } + \ No newline at end of file