fix: limit the shown text's length (close #80)

This commit is contained in:
JustSong
2023-05-16 21:33:59 +08:00
parent 519cb030f7
commit e8da98139f
3 changed files with 30 additions and 8 deletions

View File

@@ -0,0 +1,6 @@
export function renderText(text, limit) {
if (text.length > limit) {
return text.slice(0, limit - 3) + '...';
}
return text;
}