昵称文本超出换行问题

dev
zhangjinzhe 2024-09-06 09:58:42 +08:00
parent a738da56ca
commit 9071696dc6
1 changed files with 7 additions and 4 deletions

View File

@ -11,7 +11,7 @@
<image :src="postValue.avatar == '' ? '../../static/images/icon/tu3-9.jpg' :getAvatar(postValue.avatar)" mode=""></image>
</view>
<view class="user_msg">
<h4>{{postValue.nickName}}</h4>
<div class="nickNameBox">{{postValue.nickName}}</div>
<p>{{timeAgo(postInfo.createTime)}}{{postInfo.address ? '·' + postInfo.address : ""}}</p>
</view>
</view>
@ -358,10 +358,13 @@ function UNpass() {
}
.user_msg {
h4 {
.nickNameBox {
font-weight: 600;
width: 186rpx;
height: 31rpx;
max-width: 400rpx; /* 设置容器宽度 */
white-space: nowrap; /* 防止换行 */
overflow: hidden; /* 隐藏超出部分 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
// height: 31rpx;
font-size: 30rpx;
text-align: left;
color: #000000 100%;