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.
20 lines
533 B
20 lines
533 B
2 months ago
|
import normalizeWheel from 'normalize-wheel-es';
|
||
|
|
||
|
const mousewheel = function(element, callback) {
|
||
|
if (element && element.addEventListener) {
|
||
|
const fn = function(event) {
|
||
|
const normalized = normalizeWheel(event);
|
||
|
callback && Reflect.apply(callback, this, [event, normalized]);
|
||
|
};
|
||
|
element.addEventListener("wheel", fn, { passive: true });
|
||
|
}
|
||
|
};
|
||
|
const Mousewheel = {
|
||
|
beforeMount(el, binding) {
|
||
|
mousewheel(el, binding.value);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export { Mousewheel as default };
|
||
|
//# sourceMappingURL=index.mjs.map
|