You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
533 B

3 months ago
  1. import normalizeWheel from 'normalize-wheel-es';
  2. const mousewheel = function(element, callback) {
  3. if (element && element.addEventListener) {
  4. const fn = function(event) {
  5. const normalized = normalizeWheel(event);
  6. callback && Reflect.apply(callback, this, [event, normalized]);
  7. };
  8. element.addEventListener("wheel", fn, { passive: true });
  9. }
  10. };
  11. const Mousewheel = {
  12. beforeMount(el, binding) {
  13. mousewheel(el, binding.value);
  14. }
  15. };
  16. export { Mousewheel as default };
  17. //# sourceMappingURL=index.mjs.map