Vue lazy loading banner
P粉041758700
P粉041758700 2024-03-28 23:03:47
0
1
369

I have 5 banners on the page that show or hide based on user clicks.

At this point the banner data is coming from the API, I'm iterating the banner component for each banner entry on the API, any idea how I can download the image only after the user clicks? I have tried the lazy loading native behavior but the images load at the beginning because they all appear on the first scroll and I show or hide the images by user click.

P粉041758700
P粉041758700

reply all (1)
P粉448130258

You can use thev-showdirective on theimgelement and it will only show when the banner is clicked.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!