vue-fancybox

Image preview component based on vue.js
3,170 67
Install
npm install vue-fancybox
Latest Version:1.0.3
License:ISC
Last Updated:Sep 10, 2017
Links: GitHub  ·  npm
Maintainer: xiecg

Overview

Image preview component based on vue.js

More gestures are still in development.

DEMO

vue-fancybox

Install

npm install vue-fancybox --save
import fancyBox from 'vue-fancybox';

Base Usage

<div class="list" v-for="(n, index) in imageList" :data-index="index">
  <img @click="open($event)" :src="https://raw.githubusercontent.com/xiecg/vue-fancybox/HEAD/n.url">
</div>
export default {
  data () {
    return {
      imageList: [
        { width: 900, height: 675, url: 'http://ocm0knkb1.bkt.clouddn.com/1-1.jpg' },
        { width: 601, height: 1024, url: 'http://ocm0knkb1.bkt.clouddn.com/1-2.jpg' },
        { width: 1024, height: 700, url: 'http://ocm0knkb1.bkt.clouddn.com/1-3.jpg' }
      ]
    }
  },
  methods: {
    open (e) {
      fancyBox(e.target, this.imageList);
    }
  }
}

Options

fancyBox Parameter:

Parameter Description
e.target The current clicked image.
this.imageList A list of images.

this.imageList Options:

Option Description Type
width The width of the image. Number
height The height of the image. Number
url The address of the image. String

example


$ cd example

$ npm install

$ npm run dev

prompt

Need postcss-salad support

Related Packages

vue-pswipe

a vue plugin for photoswipe

16,953 105
vue-photoswipe

PhotoSwipe plugin for Vue.js 2.0

2,394 52
@elisiondesign/vue-sole-lightbox

A minimalstic single-image lightbox made for Vue.js

238 0
vue-pure-lightbox

Very lightweight, JavaScript-only, lightbox plugin for Vue.js

29,679 157
vue-preview

A Vue integration PhotoSwipe image preview plugin

20,276 637

Version History

Version Released License
1.0.3 ISC
1.0.2 ISC
1.0.1 ISC
1.0.0 ISC