样式:
view{
margin: 0;
box-sizing: border-box;
word-break: break-all;
word-wrap: break-word;
}
.intro {
width: 100%;
padding: 30px;
text-align: center;
display: flex;
box-sizing: border-box;
}
.img{
width: 200rpx;
text-align: left;
color: #999;
}
.title-box{
flex: 1;
}
.title{
width: 100%;
text-align: left;
}
内容:
<view class="intro">
<view class="img">任务标题:</view>
<view class="title-box">
<view class="title">123@@@@@@@@@@@@@@@@@@456789101112131415161718数据类型都不调整</view>
</view>
</view>
试试父容器(任务标题+123xxx的)给个 word-break: break-all;
css试下自动换行
word-break:break-all;
<view class="intro">
<view class="img">我是右边图片</view>
<view class="title-box">
<view class="title text-line-one">123@@@@@@@@@@@@@@@@@@456789101112131415161718数据类型都不调整</view>
</view>
</view>
<!--
view{
margin: 0;
box-sizing: border-box;
word-break: break-all;
word-wrap: break-word;
}
.intro {
width: 100%;
padding: 30px;
text-align: center;
display: flex;
align-items: center;
box-sizing: border-box;
}
.img{
width: 200rpx;
height: 200rpx;
margin-right: 20rpx;
}
.title-box{
flex: 1;
}
.title{
width: 100%;
}
.text-line-one {
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
-->