murongg / vue3-lazyload

A Vue3.x image lazyload plugin
https://murongg.github.io/vue3-lazyload/
166 stars 19 forks source link

Lazyloading doesn't work in Capacitor android app. #21

Closed mashrurbd closed 2 years ago

mashrurbd commented 2 years ago

Please let me know why Lazyloading doesn't work in Capacitor android app?

The plugin works great when I use it in web app. But when I compile it to an Android app using Capacitor, the lazyload doesn't work.

murongg commented 2 years ago

Doesn't the Android browser work?

mashrurbd commented 2 years ago

Doesn't the Android browser work?

Unfortunately it doesn't work when I build the Android app. But it works perfectly when I test it using development server.

murongg commented 2 years ago

@mashrurbd lazyload depend on IntersectionObserver,see: https://developer.mozilla.org/zh-CN/docs/Web/API/IntersectionObserver, view a list of compatible browsers

mashrurbd commented 2 years ago

Solved it. It seems the assets I am referring to as error image and loading image gets renamed after build.

So I had to copy them after build to www/assets and everything seems working. 😇