import { Directive , DirectiveBinding } from "vue" ; import { enableBodyScroll , disableBodyScroll } from "body-scroll-lock" ; export const BodyScrollLockDirective = { mounted ( el , binding ) { if ( el && binding . value ) { disableBodyScroll ( el ) ; } else if ( el && ! binding . value ) { enableBodyScroll ( el ) ; } } , updated ( el , binding ) { if ( el && binding . value ) { disableBodyScroll ( el ) ; } else if ( el && ! binding . value ) { enableBodyScroll ( el ) ; } } , unmounted ( el , binding ) { if ( el ) { enableBodyScroll ( el ) ; } } , } ;