最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

小程序tab實(shí)現(xiàn)頁面切換

 更新時(shí)間:2022年07月06日 15:33:59   作者:小雅雅家的小凱凱吖  
這篇文章主要為大家詳細(xì)介紹了小程序tab實(shí)現(xiàn)頁面切換,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了小程序tab實(shí)現(xiàn)頁面切換的具體代碼,供大家參考,具體內(nèi)容如下

.wxml

<view class='title'>
? ? ? <view class='titleSel' bindtap='titleClick' data-idx='0'>
? ? ? ? <text>待接收(0)</text>
? ? ? ? <hr class="{{0 == currentIndex ? 'headerLineSel' : 'headerLineUnsel'}}" />
? ? ? </view>
? ??
? ? ? <view class='titleSel' bindtap='titleClick' data-idx='1'>
? ? ? ? <text>處理中(1)</text>
? ? ? ? <hr class="{{1 == currentIndex ? 'headerLineSel' : 'headerLineUnsel'}} " />
? ? ? </view>
?
? ? ? ? <view class='titleSel' bindtap='titleClick' data-idx='2'>
? ? ? ? <text>已完成(1)</text>
? ? ? ? <hr class="{{2 == currentIndex ? 'headerLineSel' : 'headerLineUnsel'}} " />
? ? ? </view>
? </view>
?
? <!--內(nèi)容布局-->
? <view class="colors">
? ? ? <view class="colors1" wx:if="{{currentIndex==0}}">
? ? ? {{currentIndex}}
? ? ? </view>
? ? ? ?<view class="colors2" wx:if="{{currentIndex==1}}">
? ? ? ? ? ? ?{{currentIndex}}
? ? ? </view>
? ? ? ?<view class="colors3" wx:if="{{currentIndex==2}}">
? ? ? ? ? ? ?{{currentIndex}}
? ? ? </view>
</view>

.wxss

page{
? width: 100%;
? height: 100%;
}
.container {
? height: 100%;
? min-height: 100%;
? display: flex;
? flex-direction: column;
? box-sizing: border-box;
}
?
.title {
? width: 100%;
? height: 88rpx;
? background: white;
? display: flex;
? align-items: center;
? justify-content: space-around;
}
?
.titleSel {
? width: 33%;
? color: #5f6fee;
? font-size: 32rpx;
? display: flex;
? flex-direction: column;
? align-items: center;
}
?
.titleUnsel {
? color: #858fab;
? font-size: #858fab;
}
?
.headerLineSel {
? background: #5f6fee;
? height: 6rpx;
? width: 40rpx;
? position: relative;
? margin-top: 10rpx;
}
?
.headerLineUnsel {
? background: #fff;
? height: 6rpx;
? width: 40rpx;
? position: relative;
? margin-top: 10rpx;
}
?
?
.colors{
? width: 100%;
? height: 100%;
}
?
.colors1{
? width: 100%;
? height: 100%;
? background-color: royalblue;
}
.colors2{
? width: 100%;
? height: 100%;
? background-color: salmon;
}
.colors3{
? width: 100%;
? height: 100%;
? background-color: seagreen;
}

.js

data: {
? ? currentIndex: 0,
? ?
? },
?
? //用戶點(diǎn)擊tab時(shí)調(diào)用
? titleClick: function (e) {
? ? let currentPageIndex =
? ? ? this.setData({
? ? ? ? //拿到當(dāng)前索引并動(dòng)態(tài)改變
? ? ? ? currentIndex: e.currentTarget.dataset.idx
? ? ? })
?
? ? ? console.log(e.currentTarget.dataset.idx)
? },

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

江口县| 曲周县| 安国市| 文化| 南投县| 阿拉善左旗| 区。| 泾阳县| 大化| 岑溪市| 南昌市| 班戈县| 韩城市| 汝南县| 和顺县| 德格县| 鹿泉市| 集安市| 高安市| 富源县| 临武县| 芒康县| 天门市| 万源市| 长顺县| 宜兰市| 江华| 新疆| 庆元县| 无为县| 衢州市| 泰安市| 绥化市| 青田县| 同心县| 全南县| 大同市| 银川市| 乌拉特中旗| 大田县| 新绛县|