From ff80ad7185ae5fc2b81e30b57962dd60d438e75a Mon Sep 17 00:00:00 2001 From: Hepatica Date: Mon, 29 Jan 2024 22:05:15 +0100 Subject: [PATCH] Add word break --- .../src/assets/css/ComponentsStyles/chat.css | 1 + .../src/components/WritechatComponent.vue | 24 +++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/luckydiamond/src/assets/css/ComponentsStyles/chat.css b/luckydiamond/src/assets/css/ComponentsStyles/chat.css index 87ef473..19b2d4e 100644 --- a/luckydiamond/src/assets/css/ComponentsStyles/chat.css +++ b/luckydiamond/src/assets/css/ComponentsStyles/chat.css @@ -18,6 +18,7 @@ .chat { margin: 1% 3.2% 0 0; + word-break: break-all; } .chat__content { diff --git a/luckydiamond/src/components/WritechatComponent.vue b/luckydiamond/src/components/WritechatComponent.vue index 3daa1e8..78fba92 100644 --- a/luckydiamond/src/components/WritechatComponent.vue +++ b/luckydiamond/src/components/WritechatComponent.vue @@ -42,21 +42,21 @@ export default { } }, SendmsgData() { - const formattedWord = this.InsertSpaceEvery24Chars(this.msg); - this.$emit("send", [formattedWord, this.username, this.icon]); + // const formattedWord = this.InsertSpaceEvery24Chars(this.msg); + this.$emit("send", [this.msg, this.username, this.icon]); this.msg = ""; }, - InsertSpaceEvery24Chars(text) { - let result = ""; - for (let i = 0; i < text.length; i++) { - if (i > 0 && i % 24 === 0) { - result += " "; - } - result += text[i]; - } - return result; - }, + // InsertSpaceEvery24Chars(text) { + // let result = ""; + // for (let i = 0; i < text.length; i++) { + // if (i > 0 && i % 24 === 0) { + // result += " "; + // } + // result += text[i]; + // } + // return result; + // }, }, };