mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2026-02-04 18:24:14 +02:00
Add word break
This commit is contained in:
@@ -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