the following is a style and how to implement it. The nickname is too long to show the ellipsis, as shown in figure 2.
points to consider
- nickname is long, showing ellipsis
- the nickname is short, and the icon follows the nickname The icons behind
- need to be increased or decreased from time to time to make it easy to modify.
the implementation scheme that I have come up with
- css scheme (the drawback of the flex), I use at the moment is that icons and nicknames sometimes have an irresistible spacing. The second disadvantage is the compatibility of flex.
- js calculation scheme (idea), the program uses
vue
to achieve, the icon is a component, rendering notification of the above own width, dynamically modify the text width.
I would like to ask if there are any other good implementations. I have tried float
+ BFC
, but the results are not good.