RobinCK / vue-gallery

:camera: Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. 🇺🇦
https://robinck.github.io/vue-gallery/
MIT License
470 stars 85 forks source link

Multiple vue-galleries on one page #57

Closed sebastianbayer closed 6 years ago

sebastianbayer commented 6 years ago

Hi,

I'd like to include multiple vue-galleries on one page.

When i open the lightbox of one of the vue-gallery components via click I get the problem that all other lightboxes get openend as well.

To avoid that I could just simply create specific indexes for each vue-gallery like you did here: https://jsfiddle.net/Robin_ck/93n1u4ck/

But since I don't know how many vue-galleries will get created yet, I need an other way to get a clear distinction between all galleries. (The user should be able to create as many galleries on the page as he wishes…)

Is there a way to pass an id or prop as the actual index key of the components data so the right vue-gallery gets activated? How can I distinguish between multiple vue-galleries on one page?

sebastianbayer commented 6 years ago

Found the solution by setting a unique id to each gallery as described here: https://github.com/RobinCK/vue-gallery/issues/11