一、所有元素靠右:
<view class="container">
<img style="width: 50rpx;height: 50rpx;" src="https://cdn.pixabay.com/photo/2019/05/14/17/11/fruit-4202929_1280.png" alt="" />
<text>靠右显示</text>
</view>
<style lang="scss">
.container{
height: 100rpx;
background-color: cornsilk;
text-align:right;
}
</style>

二、单一元素靠右:
方式1,直接排列:
<view class="container">
<view class="left">
<img style="width: 50rpx;height: 50rpx;"
src="https://cdn.pixabay.com/photo/2019/05/14/17/11/fruit-4202929_1280.png" alt="" />
</view>
<view class="right">
<text>靠右显示</text>
</view>
</view>
<style lang="scss">
.container{
height: 100rpx;
background-color: cornsilk;
// text-align:right;
display: flex;
}
.right{
position: absolute;
right: 10rpx;
}
</style>

方式2,元素挤压:
<view class="container">
<view class="left">
<img style="width: 50rpx;height: 50rpx;"
src="https://cdn.pixabay.com/photo/2019/05/14/17/11/fruit-4202929_1280.png" alt="" />
</view>
<view class="right">
<text>靠右显示</text>
</view>
</view>
<style lang="scss">
.container{
height: 100rpx;
background-color: cornsilk;
// text-align:right;
display: flex;
}
.left{
width: 70%;
}
.right{
// position: absolute;
// right: 10rpx;
width: 30%;
}
</style>
