当前位置:网站首页>解决微信小程序swiper组件bindchange事件抖动问题
解决微信小程序swiper组件bindchange事件抖动问题
2022-07-02 06:23:00 【xuefankang】

根据官方 source 来进行判断swiper的change事件是通过什么来触发的,autoplay是自动轮播。touch是用户手动滑动。其他的就是未知问题。抖动问题主要由于未知问题引起的,所以做了限制,只有在自动轮播和用户主动触发才去改变current值,达到规避了抖动bug
// 轮播change事件
swiperChange(e) {
console.log(e);
var _this = this;
var swiperIndex = e.detail.current;
var source = e.detail.source;
// console.log('轮播事件index'+index)
if(source == 'autoplay' || source == 'touch') {
_this.setData({
swiperIndex : index
})
}
},边栏推荐
- Eggjs -typeorm 之 TreeEntity 实战
- sprintf_s的使用方法
- 部署api_automation_test过程中遇到的问题
- 蚂蚁集团g6初探
- Latex 编译报错 I found no \bibstyle & \bibdata & \citation command
- qq邮箱接收不到jenkins构建后使用email extension 发送的邮件(timestamp 或 auth.......)
- Distributed transactions: the final consistency scheme of reliable messages
- Dynamic global memory allocation and operation in CUDA
- 20210306 reprint how to make TextEdit have background pictures
- Usage of map and foreach in JS
猜你喜欢

Sparse array (nonlinear structure)

Latex在VSCODE中编译中文,使用中文路径问题解决

Build learning tensorflow

Présence d'une panne de courant anormale; Problème de gestion de la fsck d'exécution résolu

Usage of map and foreach in JS

Win10: add or delete boot items, and add user-defined boot files to boot items

Linux MySQL 5.6.51 community generic installation tutorial

Latex error: the font size command \normalsize is not defined problem solved

Redis - cluster data distribution algorithm & hash slot

Sentry construction and use
随机推荐
默认google浏览器打不开链接(点击超链接没有反应)
The default Google browser cannot open the link (clicking the hyperlink does not respond)
[self cultivation of programmers] - Reflection on job hunting Part II
Win10桌面图标没有办法拖动(可以选中可以打开可以删除新建等操作但是不能拖动)
Redis - big key problem
2020-9-23 use of QT timer qtimer class.
AWD learning
Win10:添加或者删除开机启动项,在开机启动项中添加在用户自定义的启动文件
Blog directory of zzq -- updated on 20210601
CUDA user object
ModuleNotFoundError: No module named ‘jieba. analyse‘; ‘ jieba‘ is not a package
Latex warning: citation "*****" on page y undefined on input line*
Virtualenv and pipenv installation
Log - 7 - record a major error in missing documents (A4 paper)
Linux MySQL 5.6.51 Community Generic 安装教程
Storage space modifier in CUDA
table 组件指定列合并行方法
Browser scrolling for more implementations
Fe - use of weex development weex UI components and configuration use
Functions of tensorrt