<view style="height: 80%;background-color: white;" v-for="(item,index) in chatList" :key="index">
//靠左
<view v-if="item.type === 0" style="
margin-bottom: 5px;padding:5px 5px 5px 5px;display: flex;justify-content: left;align-items: flex-start;" >
<image src="../../../static/images/tabbar/mine.png"
style="width: 25px;height: 25px;"></image>
<view style="vertical-align: top;width: 60%;border: 1px solid;border-radius: 5px;" >{{item.msg}}</view>
</view>
//靠右
<view v-if="item.type === 1" style="
margin-bottom: 5px;padding:5px 5px 5px 5px;display: flex;align-items: top;justify-content:flex-end;">
<view style="vertical-align: top;width: 60%;border: 1px solid;border-radius: 5px;">{{item.msg}}</view>
<image src="../../../static/images/tabbar/mine.png"
style="width: 25px;height: 25px;"></image>
</view>
</view>
uniapp view里的的子标签靠左或者靠右
最新推荐文章于 2024-03-30 09:18:32 发布