一行写法:
white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
多行写法:
.ellipsis-2{
display: -webkit-box;
overflow: hidden;
white-space: normal!important;
text-overflow: ellipsis;
word-wrap: break-word;
-webkit-line-clamp: 2;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */
}
手写:
stringformat: function (vstr) {
if (vstr) {
//if (vstr.length > 2)
vstr = vstr.substring(0, 1) + "***";
}
return vstr;
},
多行写法:
.ellipsis-2{
display: -webkit-box;
overflow: hidden;
white-space: normal!important;
text-overflow: ellipsis;
word-wrap: break-word;
-webkit-line-clamp: 2;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */
}
手写:
stringformat: function (vstr) {
if (vstr) {
//if (vstr.length > 2)
vstr = vstr.substring(0, 1) + "***";
}
return vstr;
},