1.1.8 • Published 3 years ago

vue-image-viewer v1.1.8

Weekly downloads
15
License
MIT
Repository
github
Last release
3 years ago

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.
1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago