1.0.4 • Published 7 years ago

vue-viewer v1.0.4

Weekly downloads
11
License
MIT
Repository
github
Last release
7 years ago

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