微信小程序模仿分类导航实现多个tab 页功能:如图
l5PsXOTCzU.gif
话不多说,也不知道说啥,直接上代码:
wxml:
<view class="swiper-tab">
<view class="swiper-tab-item {
{currentTab==0?'active':''}}" data-current="0" bindtap="clickTab">全部</view>
<view class="swiper-tab-item {
{currentTab==1?'active':''}}" data-current="1" bindtap="clickTab">分类</view>
<view class="swiper-tab-item {
{currentTab==2?'active':''}}" data-current="2" bindtap="clickTab">游戏</view>
<view class="swiper-tab-item {
{currentTab=