lightgallery-vue

vue wrapper of lightgallery.js
2,314 3
Install
npm install lightgallery-vue
Latest Version:0.0.2
Vue:2
License:MIT
Last Updated:Nov 8, 2019
Links: GitHub  ·  npm
Maintainer: zengde

Introduction

vue wrapper of lightgallery.js

online demo

Start

  1. Install

    $ npm install lightgallery-vue@latest
    
  2. Usage

    Step 1. Add lightgallery-vue component

    import lightGallery from 'lightGallery-vue';
    export default {
      components:{
        lightGallery
      }
    }
    

    Step 2. Use in template

    <lightGallery 
    	:images="modalGallerys" 
    	ref="lightGallery">
    </lightGallery>
    

    with multi add id prop

    <lightGallery 
    	id="lightGallery2"
    	:images="modalGallerys" 
    	ref="lightGallery">
    </lightGallery>
    

    Step 3. Config for lightGallery

    export default {
      data () {
        return {
          images: [{
            src: '1.jpg',
    		thumb:'2.jpg',
    		subHtml:'caption'
          }{
            src: '1.html',
    		thumb:'2.jpg',
    		subHtml:'',
    		iframe:true
          }]
        }
      }
    }
    
Attributes

Dynamic variables

Method
this.$refs.lightGallery.showImage(index);

More methods

Event

More events

Plugins

lightgallery supports your custom plugins for more content viewing plugins

import lightGallery from 'lightGallery-vue';
import 'lg-zoom.js';
import 'lg-fullscreen.js';
import 'lg-thumbnail.js';
import 'lg-autoplay.js';

Demo

$ git clone git@github.com:zengde/vue-lightgallery.git
$ cd vue-lightgallery
$ npm install
$ npm run dev

please visit http://localhost:8080/

License

MIT

Related Packages

@lightgallery/vue

Native Vue 3 lightGallery over @lightgallery/headless

809 7,056
vue

The progressive JavaScript framework for building modern web UI.

588,019,132 54,801
vue
@vueuse/shared
372,738,348 22,398
@vueuse/core

Collection of essential Vue Composition Utilities

367,188,523 22,398
@vitejs/plugin-vue

The official plugin for Vue SFC support in Vite.

333,357,380 686

Version History

Version Released Vue License
0.0.2 ^2.5.11 MIT
0.0.1 ^2.5.11 MIT