selimdoyranli/v-lazy-component

Components always get mounted when out of view

jackkitley opened this issue · 3 comments

Thanks for the plugin.

Im lazy loading multiple components but they all load in on dom render.

Screenshot 2023-08-28 at 15 26 46
Screenshot 2023-08-28 at 15 26 54

i just tried it and it doesn't seem to be a problem. Also the multiple render issue can't be possible because there is an example with multiple lazy components in the demo. there I would have noticed it. Please make sure that lazy components are not in the viewport at the same time. Also check values like thereshold, rootMargin. I'm closing this issue for now, ping me again in any case.

@selimdoyranli thanks for the feedback. So I got it right in the end. The components were for a brief moment all in view and then they expanded. So for that quick moment it was in view.

So what I did was set a style min height on the lazy-component and this prevented them all from being collapsed in the beginning.

The props for the lazy component didn't seem to help. Root margin and threshold