微信小程序如何实现左侧导航栏(微信小程序,开发技术)

时间:2024-05-06 23:58:32 作者 : 石家庄SEO 分类 : 开发技术
  • TAG :

wxml

<viewclass="content"><viewclass='left'><viewclass="{{flag==0?'select':'normal'}}"id='0'bindtap='switchNav'>8:00-9:00</view><viewclass="{{flag==1?'select':'normal'}}"id='1'bindtap='switchNav'>9:00-10:00</view><viewclass="{{flag==2?'select':'normal'}}"id='2'bindtap='switchNav'>14:00-15:00</view><viewclass="{{flag==3?'select':'normal'}}"id='3'bindtap='switchNav'>15:00-16:00</view></view><viewclass='right'><viewclass='category'><swipercurrent='{{currentTab}}'style='height:500px'vertical="{{true}}"><swiper-itemid='0'catchtouchmove="stopTouchMove">专家A</swiper-item><swiper-itemid='1'catchtouchmove="stopTouchMove">专家B</swiper-item><swiper-itemid='2'catchtouchmove="stopTouchMove">专家C</swiper-item><swiper-itemid='3'catchtouchmove="stopTouchMove">专家D</swiper-item></swiper></view></view></view>

wxss

.content{display:flex;flex-direction:row;font-family:"MicrosoftYaHei"}.left{width:30%;font-size:10px;height:500px;background-color:#F4F4F4;}.leftview{text-align:center;height:45px;line-height:45px;}.select{background-color:#ffffff;border-left:2pxsolid#36AE66;font-weight:bold;color:#36AE66;}.normal{background-color:#F4F4F4;border-bottom:1pxsolid#f2f2f2;}.right{width:70%;margin:0px;}

js

Page({data:{flag:0,currentTab:0},switchNav:function(e){varpage=this;varid=e.target.id;if(this.data.currentTab==id){returnfalse;}else{page.setData({currentTab:id});}page.setData({flag:id});},catchTouchMove:function(res){returnfalse}})

实现效果

微信小程序如何实现左侧导航栏

 </div> <div class="zixun-tj-product adv-bottom"></div> </div> </div> <div class="prve-next-news">
本文:微信小程序如何实现左侧导航栏的详细内容,希望对您有所帮助,信息来源于网络。
上一篇:面试必问的一个知识点,关于HandlerThread的使用场景以及怎样使用 HandlerThrea下一篇:

7 人围观 / 0 条评论 ↓快速评论↓

(必须)

(必须,保密)

阿狸1 阿狸2 阿狸3 阿狸4 阿狸5 阿狸6 阿狸7 阿狸8 阿狸9 阿狸10 阿狸11 阿狸12 阿狸13 阿狸14 阿狸15 阿狸16 阿狸17 阿狸18