export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.directive('scroll', {
mounted (el, fn) {
const f = function (e: Event) {
return fn.value(e, el)
}
window.addEventListener('scroll', f)
},
unmounted (el, fn) {
const f = function (e: Event) {
return fn.value(e, el)
}
window.removeEventListener('scroll', f)
},
})
})