An image gallery component like Lightbox for Vue 2.x.
View the Project on GitHub Office-asoT/Glitter
Click here to open the image gallery.
Install @asot/glitter:
npm install @asot/glitter --save
Then register Glitter in your components and use it:
<template> <div id="app"> <glitter v-bind:images="[ '/path/to/image', // Or you can specify a caption // via object notation. { src: '/path/to/image', caption: 'Hello @asot/glitter!' }, ]"> <p>Click here to open the image gallery.</p> </glitter> </div> </template> <script> import Glitter from '@asot/glitter'; import '@asot/glitter/dist//Glitter.css' export default { name: 'app', components: { Glitter, } } </script>
Include @asot/glitter in your page then use it.
<script src="https://unpkg.com/vue"></script> <script src="https://unpkg.com/@asot/glitter/dist/Glitter.umd.min.js"></script> <link rel="stylesheet" href="https://unpkg.com/@asot/glitter/dist//Glitter.css"> <div id="app"> <glitter v-bind:images="[ '/path/to/image', // Or you can specify a caption // via object notation. { src: '/path/to/image', caption: 'Hello @asot/glitter!' }, ]"> <p>Click here to open the image gallery.</p> </glitter> </div> <script> // Local Registration new Vue({ components: { Glitter } }).$mount('#app') </script>