首页 > 解决方案 > 为什么 vue-lazyload 会同时监听 'wheel' 、 'touchmove' 和 'scroll' 事件?

问题描述

vue-lazyload 的默认监听事件包括 'scroll'、'wheel'、'mousewheel'、'resize'、'animationend'、'transitionend' 和 'touchmove'。

var DEFAULT_EVENTS = ['scroll', 'wheel', 'mousewheel', 'resize', 'animationend', 'transitionend', 'touchmove'];

当 'wheel' 或 'touchmove' 发射时,'scroll' 也会发射。监听“滚动”事件时是否有必要监听“轮子”和“触摸移动”?

标签: javascriptvue.jslazy-loading

解决方案


推荐阅读