vue-viewer

a simple component for preview image
5,503 11
Install
npm install vue-viewer
Latest Version:1.0.4
Vue:2
License:MIT
Last Updated:Apr 4, 2018
Links: GitHub  ·  npm
Maintainer: yyl

Install

npm install vue-viewer  --save

仓库地址: ssh://git@github.com:yylgit/vue-viewer.git

API

props: {
  src: {
    type: String
  },
  alt: {
    type: String,
    default: ''
  },
  value: {
    type: Boolean,
    default: false
  }
}

Usage

<template>
    <div>
      <viewer v-model="showImage" :src="imageSrc">
      </viewer>
      <el-button  @click="showImageClick">显示</el-button>
    </div>
</template>

<script type="text/babel">
  import Viewer from '../dist/vue-viewer';
    export default {
      data: function() {
        return {
          showImage: false,
          imageSrc: 'http://p0.meituan.net/qcs/4662a009da0eafd379f3172a524127e1120196.jpg'
        }
      },
      components: {
        Viewer
      },
      methods: {
        showImageClick () {
          this.showImage = true;
        }
      }
    }
</script>

<style lang="scss" rel="stylesheet/scss" scoped>    
</style>


ScreenShot

image description

Related Packages

vue-lightbox-lite

A lightweight image and video lightbox gallery component for Vue

4,093 3
vue-image-pro

An Image Component for Vue.js | 一个Vue图片增强组件

1,340 5
vue-previewable-image

A previewable image Vue component based on viewerjs.

2,744 4

Version History

Version Released Vue License
1.0.4 ^2.1.7 MIT
1.0.3 ^2.1.7 MIT
1.0.2 ^2.1.7 MIT
1.0.1 ^2.1.7 MIT