Add word break

This commit is contained in:
Hepatica
2024-01-29 22:05:15 +01:00
parent dead4e8c2a
commit ff80ad7185
2 changed files with 13 additions and 12 deletions

View File

@@ -18,6 +18,7 @@
.chat {
margin: 1% 3.2% 0 0;
word-break: break-all;
}
.chat__content {

View File

@@ -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;
// },
},
};
</script>