The Wayback Machine - https://web.archive.org/web/20200917115338/https://github.com/olitaylor/vlightbox
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Build Status

vlightbox

Simple native Vue.js lightbox

Demo

https://olitaylor.github.io/vlightbox/

Install

Vue Compatibility

Compatible with Vue 2.0

NPM

$ npm install vlightbox

Register the component

import lightbox from 'vlightbox';
Vue.use(lightbox);

Basic markup should look like this

<lightbox :currentImage="currentImageFather"
          :overlayActive="overlayActiveFather"
          >
          <div v-for="(image, index) in images" :key="image.id">
                <img src="image.src" v-on:click="clickImage(index)">
          </div>
</lightbox>

<script>
export default {
    data () {
        return {
             images: [
                {
                    id: 1,
                    src:"path/to/image"
                },
            ],
            currentImageFather: null,
            overlayActiveFather: false,
        }
    },
    methods: {
        clickImage(index) {
            this.currentImageFather = index
            this.overlayActiveFather = true
        }
    }
}
</script>

Other options are;

Remove all styles to the image gallery, overlay not included

  • Default: false
:resetstyles="false" 

Loop back to the first image when at the end of the gallery

  • Default: true
:loop="true" 

Show next, back and close buttons on overlay

  • Default: true
:nav="true" 

Show captions on images with the caption property

  • Default: true
:caption="true"

More features coming soon!

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.