const lazyload = (el, binding) => {
    el.dataset.src = binding.value
    const observer = new IntersectionObserver((entries) => {
        entries.forEach((entry) => {
            if (entry.isIntersecting) {
                const img = entry.target
                img.src = img.dataset.src
                observer.unobserve(img)
            }
        })
    })
    observer.observe(el)
}

export default lazyload
