@opensig/opendesign
Version:
25 lines (24 loc) • 485 B
JavaScript
import { useScrollbar } from "./use-scrollebar.mjs";
const scrollbarMap = /* @__PURE__ */ new WeakMap();
const vScrollbar = {
mounted(el, binding) {
const value = binding.value;
if (value === false) {
return;
}
const { unmount } = useScrollbar({
target: el,
...value
});
scrollbarMap.set(el, unmount);
},
unmounted(el) {
const unmount = scrollbarMap.get(el);
if (unmount) {
unmount();
}
}
};
export {
vScrollbar
};