Socket
Socket
Sign inDemoInstall

vue-image-viewer

Package Overview
Dependencies
14
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-image-viewer

a simple and lightweight image viewer.


Version published
Weekly downloads
165
increased by135.71%
Maintainers
1
Install size
818 kB
Created
Weekly downloads
 

Readme

Source

npm version MIT Licence

vue-image-viewer

a simple and lightweight picture viewer. Demo

一个用于Vue2.0的简单且轻量化的图片查看器。

Install

npm install vue-image-viewer --save

Usage

import imageViewer from "vue-image-viewer";

Vue.use(imageViewer);

export default {
    data() {
        return {
            images : [
                {
                    name : "image1",
                    url : "/static/images/1.jpg"
                },
                {
                    name : "image2",
                    url : "/static/images/2.png"
                },
                {
                    url : "/static/images/3.gif"
                }
            ]
        }
    },
    created() {
        this.$imageViewer.images(this.images);
    },
    methods : {
        imageView(index) {
            this.$imageViewer.index(index);
            this.$imageViewer.show();
        }
    }
}
<img v-for="(item,index) in images" :key="index" :src="item.url" @click="imageView(index)">

Events

NameParamsTypeDescription
show--Open picture viewer.
hide--Close picture viewer.
indexnumNumberWhich image to show first.
pagenumNumberThe page of the thumbnail list.
imagesdataArraySet image list.

Keywords

FAQs

Last updated on 18 Aug 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc