小程序 - 不显示列表最后一条分割线
2020-09-22 本文已影响0人
泛滥的小愤青
image.png
wxml
<block wx:for="{{ outputItem.data.relatedQuestions }}" wx:key="id" wx:for-index="idx">
<view class='relatedQuestion-text' wx:if="{{ idx != 0 }}">
<view>
<rich-text bindtap='relatedQuestion' data-question='{{ item }}'>{{ idx }}、{{ item }}</rich-text>
</view>
<!-- 分割线 -->
<view wx:if="{{ idx != outputItem.data.relatedQuestions.length - 1 }}" class="solid"></view>
</view>
</block>
wxss
.relatedQuestion-text {
line-height: 48rpx;
color : #AF1F25;
padding-top:20rpx;
}
/* 分割线 */
.solid {
border :1px solid #E3E3E3; /* #E3E3E3 */
width: 100%;
margin-top: 20rpx;
}