Vue gets the data at the backend, how to hide the excess and use ellipses?

I got the back-end text and set css

html


as usual. I tried to write the text to death, and it worked, but this is a data interaction, and I can"t write it to death. In this case, how to hide the excess part and express it with ellipsis?

Mar.14,2021

white-space: nowrap; 
text-overflow: ellipsis;
overflow: hidden;
width: 100px;//

Why write curly braces and write v-html ?


text-overflow: ellipsis;

see document

for details.

you can do hack processing, hide it first, and then add the ellipsis
-sharpnews_content p {

.
font-size: .16rem;
font-weight: 200;
line-height:.35rem;
height: .7rem;
overflow: hidden;
cursor: pointer;
padding-right: 20px;
position: relative;

}
-sharpnews_content p:after {

content:"...";
position: absolute;
right: 16px;
bottom: 0;

}

Menu