vue-image-viewer

a simple and lightweight image viewer.
3,245 4
Install
npm install vue-image-viewer
Latest Version:1.1.8
Vue:2
License:MIT
Last Updated:Dec 7, 2022
Links: GitHub  ·  npm
Maintainer: chihai

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="https://raw.githubusercontent.com/ChiHai-Chuck/vue-image-viewer/HEAD/item.url" @click="imageView(index)">

Events

Name Params Type Description
show - - Open picture viewer.
hide - - Close picture viewer.
index num Number Which image to show first.
page num Number The page of the thumbnail list.
images data Array Set image list.

Related Packages

@dullar/mercury

Advanced and highly reusable Mobile UI Components built on Vue2 & You can define...

8,553 6
@halobear/vue-upload

vue上传组件

460 1
vite-plugin-vue2

Vite plugin for Vue2

1,474,659 618
vue-jstree

a tree plugin for vue2

137,015 630
vite-plugin-git-revision

Vite plugin that generates VERSION and COMMITHASH files during build based on a...

21,961 11

Version History

Version Released Vue License
1.1.8 ^2.5.17 MIT
1.1.7 ^2.5.17 MIT
1.1.6 ^2.5.17 MIT
1.1.5 ^2.5.17 MIT
1.1.3 ^2.5.17 MIT