mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
Add word break
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
.chat {
|
||||
margin: 1% 3.2% 0 0;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.chat__content {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user