直接上例子
<view class="my-td" bindtap='changeToAddr' style="margin-top:50rpx" bindtap='toMyAddr'>
<text>我的地址</text>
<image src="../Images/right_point.png" mode='widthFix'></image>
</view>
text在左,image在右,则css样式为
.my-td{
display:flex;align-items:center;width:90%;height:130rpx;margin-left:5%;
}
.my-td image{
width:15rpx;margin-left: auto;
}
.my-td text{
font-size:28rpx;color:#505050;font-weight:Bold;font-family:PingFang-SC-Bold;
}
最关键的就一个语句:margin-left: auto;