使用last-child或者first-child 需要将子集包在一个父元素中才可以生效
.tab-content text:last-child {
margin-right: 0;
}
<view class="tab-content"><text bindtap="tapActive" data-active="1" class="{{active === '1'?'active':''}}">贸易代采</text><text bindtap="tapActive" data-active="2" class="{{active === '2'?'active':''}}">应收账款</text><text bindtap="tapActive" data-active="3" class="{{active === '3'?'active':''}}">存货质押</text><text bindtap="tapActive" data-active="4" class="{{active === '4'?'active':''}}">预付货款</text><text bindtap="tapActive" data-active="5" class="{{active === '5'?'active':''}}">普惠金融</text></view>