clampy-js / vue-clampy

Vue.js (2+) directive that clamps the content of an element by adding an ellipsis to it if the content inside is too long.
MIT License
78 stars 9 forks source link

this very good! thanks ! #5

Closed zhg-645479206 closed 5 years ago

zhg-645479206 commented 5 years ago

use overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;

on some android (h5),the text ends with two dots.

you use javascript methods, don't use css , the compatibility problem is solved indirectly.

Fabulous !

alexandremoore commented 5 years ago

You should not use the library if you already use a CSS solution (text-overflow: ellipsis and line-clamp).

Personally, in my projects, I use the CSS solution (text-overflow: ellipsis) to truncate 1 single line of text. When I need to truncate on multiple lines of text, I use my library.

CSS line-clamp is great but not all browsers support it, hence why I created this library.