위챗 애플릿 페이지 내비게이션
14076 단어 일상 노트
<view class="navbar">
<lable wx:for="{{navbar}}" data-idx="{{index}}" class="item {{currentTab==index ? 'active' : ''}}" wx:key="unique" bindtap="navbarTap">
<text>{{item}}</text>
</lable>
</view>
<view class="zhanwei"></view>
<!-- -->
<view hidden="{{currentTab!==0}}" >
<view wx:if="{{list.length>0}}">
<!-- -->
<view class='cont_count' wx:for="{{list}}" wx:key="key" >
</view>
</view>
<!-- -->
<view wx:else>
<!-- -->
<view class='cont_count'>
<label class='none_tab'> </label>
</view>
</view>
</view>
<!-- -->
<view hidden="{{currentTab!==1}}" >
<view wx:if="{{list.length>0}}">
<!-- -->
<view class='cont_count' wx:for="{{list}}" wx:key="key" >
</view>
</view>
<!-- -->
<view wx:else>
<!-- -->
<view class='cont_count'>
<label class='none_tab'> </label>
</view>
</view>
</view>
.js
data: {
navbar: [' ', ' '],
currentTab:0,
},
// tab
navbarTap: function (e) {
var that = this;
this.setData({
currentTab: e.currentTarget.dataset.idx
})
that.data.currentTab = e.currentTarget.dataset.idx
console.log(e.currentTarget.dataset.idx)
if (e.currentTarget.dataset.idx==0){
}else{
}
},
wxss
.navbar{
display: flex;
background: #fff;
position: fixed;
z-index: 9999;
width: 100%
}
.zhanwei{
width: 100%;
height: 86rpx;
}
.navbar .item{
position: relative;
flex: auto;
font-size: 27rpx;
width: 100rpx;
text-align: center;
line-height: 80rpx;
color: #999999;
border-bottom: 6rpx solid #ddd;
}
/* */
.navbar .item.active{
color: #5ABE64;
border-bottom: 6rpx solid #5ABE64;
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
NGINX 학습 노트 180 포트 를 사용 하 는 소프트웨어 나 서 비 스 를 닫 고 netstat - nao 를 입력 하여 프로 세 스 링크 상황 을 보고 PID 가 작업 관리자 에서 해당 하 는 PID 를 찾 아 프로 세 스 를 끝 냅...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.