1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 微信小程序swiper组件真机模拟时疯狂轮播 问题解决完整代码

微信小程序swiper组件真机模拟时疯狂轮播 问题解决完整代码

时间:2020-05-08 23:20:25

相关推荐

微信小程序swiper组件真机模拟时疯狂轮播  问题解决完整代码

公司 个人 家庭 社会 国家

张伯礼院士:除湖北外,全国其他省市4月底应可恢复正常秩序

个人内容列表

家庭内容列表

社会内容列表

国家内容列表 国家内容列表 国家内容列表 国家内容列表 国家内容列表 国家内容列表 国家内容列表 国家内容列表 国家内容列表 国家内容列表 国家内容列表 国家内容列表 国家内容列表

index.wxss

.swiper-tab {/* overflow-x:hidden;/ width: 100%; border-bottom: 2rpx solid #ccc; text-align: center; height: 60rpx; line-height: 30rpx; display: flex; flex-flow: row; justify-content: space-between;}

.swiper-tab-item { width: 30%; height: 100%; color: #434343; /border:1px solid #ccc;/}

.active { color: rgb(89, 246, 160); border-bottom: 4rpx solid rgb(89, 246, 128);}

/设置下面内容区域的页面情况 */swiper { text-align: left; height: 8000rpx;}

.gongsi, .gongsi-content { height: 100rpx;}

.geren, .geren-content { height: 100%;}

.jiating, .jiating-content { height: 100%;}

.shehui .shehui-content { height: 100%;}

.goujia, .goujia-content { height: 100%;}

index.js

Page({ data: { /** * 页面配置 */ duration:300, currentTab: 0, autoplay:false, interval:3000 },//滑动切换 问题就出在这个方法里 swiperTab: function (e) { var that = this; if (e.detail.source == ‘autoplay’ || e.detail.source == ‘touch’) { that.setData({ currentTab: e.detail.current }); } }, //点击切换 clickTab: function (e) { var that = this; if (this.data.currentTab === e.target.dataset.current) { return false; } else { console.log(‘clickTab2’) that.setData({ currentTab: e.target.dataset.current }) } },

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。