Splidejs / vue-splide

The Splide component for Vue.
MIT License
328 stars 77 forks source link

LazyLoad support ? #68

Closed FrenchGithubUser closed 2 years ago

FrenchGithubUser commented 2 years ago

Checks

Version

0.5.18 (vue-splide)

Description

As written in the documentation, I used the data-splide-lazy="path-to-image" with the lazyLoad: true option. The 2 first images are loaded but not the next ones.

The problem is that when scrolling to the next ones, a loading animation is displayed but the next images are not loaded and no request is made in the network tab.

Another problem I encountered, I couldn't catch the lazyload:loaded event with @lazyload:loaded

Reproduction Link

No response

Steps to Reproduce

Add multiple images to a vue-splide component with lazy-load enabled

Expected Behaviour

Lazy loads the images

NaotoshiFujita commented 2 years ago

It's working as I expected: https://codesandbox.io/s/lazyload-p8isup?file=/src/components/BasicExample.vue

FrenchGithubUser commented 2 years ago

Thanks for the example ! But what about the lazyload:loaded event ?

NaotoshiFujita commented 2 years ago

The splide prefix is missing. https://splidejs.com/integration/vue-splide/#events

FrenchGithubUser commented 2 years ago

thanks again !

FrenchGithubUser commented 2 years ago

okay now the event works but for some reason it will still not load more than 2 pictures. The event visible is fired when scrolling to a loading splide but no request is made to the server and no error is displayed in the console