在微信小程序中如何使用YDUI的ScrollTab组件
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了在微信小程序中如何使用YDUI的ScrollTab组件,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2225字,纯文字阅读大概需要4分钟。
内容图文
![在微信小程序中如何使用YDUI的ScrollTab组件](/upload/InfoBanner/zyjiaocheng/288/45a1693d9c7f4f5dbedb6b8c81f7d830.jpg)
本文实例为大家分享了微信小程序实现滚动选项卡效果的具体代码,供大家参考,具体内容如下
DEMO下载
效果图
YDUI的ScrollTab(滚动选项卡)
WXML
<!--导航 --> <view class="tui-fixed-left"> <scroll-view class="tui-city-scroll" scroll-x="true"> <text bindtap="getStatus" id="NAV{{index}}" class="tui-nav-li {{index === status ? 'tui-nav-active' : ''}}" data-index="{{index}}" wx:for="{{navList}}">{{item}}</text> </scroll-view> </view> <!--列表滚动区 --> <view class="tui-fixed-y"> <scroll-view class="tui-city-scroll-y" scroll-y="true" scroll-into-view="NAV{{status}}" scroll-with-animation="true"> <view wx:for="{{navList}}"> <view id="NAV{{index}}" class="tui-list-head">{{item}}</view> <view class="tui-list-li">{{item}} 列表 {{index}}</view> </view> </scroll-view> </view>
WXSS
.tui-fixed-x{ margin-left: 130px; position: fixed; top: 0; left: 0; } .tui-fixed-left{ width: 120px; height: 100%; border-right: 1px solid #dfdfdf; position: fixed; background-color: #f5f5f5; top: 0; left: 0; } .tui-list-head{ background-color: #fff; margin-bottom: 15px; } .tui-city-scroll{ width: 100%; } .tui-nav-li{ font-size: 30rpx; padding: 0 10px; height: 100rpx; line-height: 100rpx; width: 100px; display: block; border-bottom: 1px solid #dfdfdf; position: relative; z-index: 10; } .tui-nav-active{ background-color: #fff; } .tui-fixed-y{ margin-left: 120px; padding-left: 10px; padding-right: 10px; height: 100%; position: fixed; bottom: 0; right: 0; } .tui-city-scroll-y{ height: 100%; box-sizing: border-box; } .tui-list-head{ height: 50px; line-height: 50px; text-align: center; font-size: 30rpx; color: blue; } .tui-list-li{ height: 400px; padding: 10rpx; color: #fff; font-size: 50rpx; background-color: lightgreen; }
JS
Page({ data: { navList: ['今日特惠', '烟灶推荐', '净水饮水推荐', '洗碗机推荐', '电热推荐', '燃热推荐', '消毒柜推荐', '嵌入式推荐', '商用电器', '活动说明'], status: 0 }, getStatus(e) { this.setData({ status: e.currentTarget.dataset.index }) } })
上面是我整理给大家的,希望今后会对大家有帮助。
相关文章:
在vue中如何实现图片loading组件
为什么Node.js会成为Web应用开发?
在Node.js中如何获取文件上传进度?
以上就是在微信小程序中如何使用YDUI的ScrollTab组件的详细内容,更多请关注Gxl网其它相关文章!
内容总结
以上是互联网集市为您收集整理的在微信小程序中如何使用YDUI的ScrollTab组件全部内容,希望文章能够帮你解决在微信小程序中如何使用YDUI的ScrollTab组件所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。