Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-fancybox

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-fancybox

Image preview component based on vue.js

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
216
decreased by-9.62%
Maintainers
1
Weekly downloads
 
Created
Source

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="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:

ParameterDescription
e.targetThe current clicked image.
this.imageListA list of images.

this.imageList Options:

OptionDescriptionType
widthThe width of the image.Number
heightThe height of the image.Number
urlThe address of the image.String

example


$ cd example

$ npm install

$ npm run dev

prompt

Need postcss-salad support

Keywords

FAQs

Package last updated on 10 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc