mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2026-02-04 10:14:14 +02:00
Add word break
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
.chat {
|
.chat {
|
||||||
margin: 1% 3.2% 0 0;
|
margin: 1% 3.2% 0 0;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat__content {
|
.chat__content {
|
||||||
|
|||||||
@@ -42,21 +42,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
SendmsgData() {
|
SendmsgData() {
|
||||||
const formattedWord = this.InsertSpaceEvery24Chars(this.msg);
|
// const formattedWord = this.InsertSpaceEvery24Chars(this.msg);
|
||||||
this.$emit("send", [formattedWord, this.username, this.icon]);
|
this.$emit("send", [this.msg, this.username, this.icon]);
|
||||||
this.msg = "";
|
this.msg = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
InsertSpaceEvery24Chars(text) {
|
// InsertSpaceEvery24Chars(text) {
|
||||||
let result = "";
|
// let result = "";
|
||||||
for (let i = 0; i < text.length; i++) {
|
// for (let i = 0; i < text.length; i++) {
|
||||||
if (i > 0 && i % 24 === 0) {
|
// if (i > 0 && i % 24 === 0) {
|
||||||
result += " ";
|
// result += " ";
|
||||||
}
|
// }
|
||||||
result += text[i];
|
// result += text[i];
|
||||||
}
|
// }
|
||||||
return result;
|
// return result;
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user