先放实现效果图:
结构:
<scroll-view scroll-x class="nav-tab-wrap" :throttle="false" @scroll="scrollEvent">
<view class="nav-tab">
<block v-for="(item,index) in tabList">
<view class="nav-tab-item" :class="{
'active':currentIndex==index}" @tap="changeTab(index)">{
{item}}</view>
</block