First of all, thanks a lot for this lightbox : it's easy to use and it has really nice features
I checked that the correct images are displayed everywhere, i.e. in the thumbnail tabs the "thumb" image is displayed and the main image is the "src" one, which is the case
<template>
<b-container fluid class="pl-5 pr-5">
<cool-light-box
:items="coolLightBoxItems"
:index="index"
@close="index = null"
:fullScreen="true"
/>
<b-row class="images-wrapper">
<b-col
cols="12"
xl="4"
lg="6"
class="image-col mb-3"
v-for="(image, imageIndex) in coolLightBoxItems"
:key="imageIndex"
@click="triggerLightbox(imageIndex)"
>
<b-img-lazy
class="image"
:src="image.thumb"
:alt="image.description"
:title="image.description"
rounded
/>
</b-col>
</b-row>
</b-container>
</template>
<script>
const CoolLightBox = () => import("vue-cool-lightbox");
export default {
name: "Home",
components: {
CoolLightBox
},
data: () => ({
photos: [
{
author: "First guy",
description: "Cool photo",
slug: "photo1"
},
{
author: "Other dude",
description: "Other photo",
slug: "photo2"
},
{
author: "First guy",
description: "Guess what ? This is a photo",
slug: "photo3"
}],
index: null
}),
computed: {
coolLightBoxItems() {
return this.photos.map(p => ({
title: p.author,
description: p.description,
src: require(`@/assets/photos/${p.slug}.jpg`),
thumb: require(`@/assets/photos/thumbnails/${p.slug}.jpg`)
}));
}
},
methods: {
triggerLightbox(index) {
this.index = index;
}
}
};
</script>
Is there any way to make the loading of full-size images truely lazy ? Did I miss an option somewhere ?