bootstrap-vue-next
Version:
BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.
22 lines (21 loc) • 742 B
JavaScript
import "vue";
import { useScrollspy } from "../../composables/useScrollspy/index.mjs";
import { o as omit } from "../../../object-0ALvRU0O.mjs";
const bind = (el, binding) => {
if (el.$__scrollspy) el.$__scrollspy.cleanup();
const { arg, value } = binding;
const isObject = typeof value === "object" && value !== null;
const content = arg ? arg : typeof value === "string" ? value : isObject ? value.content || value.element : null;
el.$__scrollspy = useScrollspy(content, el, isObject ? omit(value, ["content", "element"]) : {});
};
const vBScrollspy = {
mounted: bind,
updated: bind,
beforeUnmount(el) {
if (el.$__scrollspy) el.$__scrollspy.cleanup();
}
};
export {
vBScrollspy
};
//# sourceMappingURL=index.mjs.map