单行文本溢出显示省略号
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
多行文本溢出显示省略号
display:-webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp:3;
overflow: hidden;
截断一个字符串 用 ‘…’ 附加到结尾
const truncateString = (str, num) =>
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;