html:
<div class="assetsItemRightP">
<div class="assetsRightPItem">
<span class="assetCul">啊啊啊</span><span>{{item.assets_code}}</span>
</div>
<div class="assetsRightPItem">
<span class="assetCul">杀杀杀</span><span>{{item.assets_name}}</span>
</div>
<div class="assetsRightPItem">
<span class="assetCul">顶顶顶:</span><span>{{item.category_name}}</span>
</div>
</div>
css:
.assetsItemRightP {
margin-top: 5px;
width: 208px;
margin-bottom: 7px;
.assetsRightPItem {
font-size: 14px;
display: flex;
width: 208px;
overflow: hidden;
flex-shrink: 0;
// 可以添加下面这两个,解决数字和字母不换行的问题,可能一个就可以
word-break: break-all;
word-wrap: break-word;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
margin-top: 3px;
.assetCul{
width: 75px;
display: inline-block;
}
}
}