微信小程序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 }) } },

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值