您好,登錄后才能下訂單哦!
這篇文章將為大家詳細(xì)講解有關(guān)微信小程序?qū)崿F(xiàn)MUI頂部導(dǎo)航欄選項(xiàng)卡的方法,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
DEMO下載
效果圖
WXML
<import src="../../template/list.wxml"/> <view class="tui-tabbar-content"> <view class="tui-tabbar-group"> <text data-id="0" bindtap="changeTabbar" class="tui-tabbar-cell {{index == 0 ? 'tui-active' : ''}}">已獲得賞金</text> <text data-id="1" bindtap="changeTabbar" class="tui-tabbar-cell {{index == 1 ? 'tui-active' : ''}}">賞金在路上</text> <text data-id="2" bindtap="changeTabbar" class="tui-tabbar-cell {{index == 2 ? 'tui-active' : ''}}">邀請失敗</text> </view> </view> <view class="tui-list-box {{index == 0 ? '' : 'tui-hide'}}"> <template wx:for="{{['選項(xiàng)卡一子選項(xiàng) - 1','選項(xiàng)卡一子選項(xiàng) - 2','選項(xiàng)卡一子選項(xiàng) - 3','選項(xiàng)卡一子選項(xiàng) - 4','選項(xiàng)卡一子選項(xiàng) - 5','選項(xiàng)卡一子選項(xiàng) - 6','選項(xiàng)卡一子選項(xiàng) - 7','選項(xiàng)卡一子選項(xiàng) - 8']}}" is="listNoneOnly" data="{{item}}"></template> </view> <view class="tui-list-box {{index == 1 ? '' : 'tui-hide'}}"> <template wx:for="{{['選項(xiàng)卡二子選項(xiàng) - 1','選項(xiàng)卡二子選項(xiàng) - 2','選項(xiàng)卡二子選項(xiàng) - 3','選項(xiàng)卡二子選項(xiàng) - 4','選項(xiàng)卡二子選項(xiàng) - 5']}}" is="listNoneOnly" data="{{item}}"></template> </view> <view class="tui-list-box {{index == 2 ? '' : 'tui-hide'}}"> <template wx:for="{{['選項(xiàng)卡三子選項(xiàng) - 1','選項(xiàng)卡三子選項(xiàng) - 2','選項(xiàng)卡三子選項(xiàng) - 3']}}" is="listNoneOnly" data="{{item}}"></template> </view>
WXSS
page{background-color: #efeff4;} .tui-tabbar-content{ padding: 10px; } .tui-tabbar-group{ border: 1px solid #4cd964; border-radius: 3px; overflow: hidden; width: 100%; display: table; table-layout: fixed; color: #4cd964; } .tui-tabbar-cell{ display: table-cell; width: 100%; height: 80rpx; line-height: 80rpx; font-size: 35rpx; text-align: center; } .tui-tabbar-cell:not(:last-child){border-right: 1px solid #4cd964;} .tui-tabbar-cell.tui-active{background-color: #4cd964;color: #fff;} .tui-list-box{border-top:1px solid #c8c7cc;}
JS
Page({ data: { index: 0 }, changeTabbar(e){ this.setData({ index: e.currentTarget.dataset.id}) } })
關(guān)于微信小程序?qū)崿F(xiàn)MUI頂部導(dǎo)航欄選項(xiàng)卡的方法就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。