index.js 832 B

123456789101112131415161718192021222324252627
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var normalizeWheel = require('normalize-wheel-es');
  4. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  5. var normalizeWheel__default = /*#__PURE__*/_interopDefaultLegacy(normalizeWheel);
  6. const mousewheel = function(element, callback) {
  7. if (element && element.addEventListener) {
  8. const fn = function(event) {
  9. const normalized = normalizeWheel__default["default"](event);
  10. callback && Reflect.apply(callback, this, [event, normalized]);
  11. };
  12. element.addEventListener("wheel", fn, { passive: true });
  13. }
  14. };
  15. const Mousewheel = {
  16. beforeMount(el, binding) {
  17. mousewheel(el, binding.value);
  18. }
  19. };
  20. exports["default"] = Mousewheel;
  21. //# sourceMappingURL=index.js.map