<view class="viewBox" abc="123"></view>
css
.viewBox {
max-width: 100%;
min-height: 400rpx;
display: block;
position: relative;
background-color: #000;
}
.viewBox::after{
content:attr(abc);
color:#fff;
font-size: 26rpx;
background-color: rgba(3, 3, 3,0.5);
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
}
支持的 我这样写是可以的