废话不多说,直接上代码:
先上效果
页面
<view class="view">
<text class='text'>2</text>
</view>
样式
.view{
position: absolute;
right: -13rpx;
top: -6rpx;
width: 30rpx;
height: 30rpx;
background-color:#FF445E;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.text{
color: #ffffff;
font-size: 20rpx;
}