newming / view-img

a component for mobile preview img with hammerjs. support move and zoom

Home Page:https://newming.github.io/view-img

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

view-img for vue.js

please use the new library instead

a component for mobile preview img with hammerjs. support move and zoom

demo

Usage

npm install view-img

A.Globally

// in your app entry
import ViewImg from 'view-img'
Vue.use(ViewImg)

// then in your templete write
// <view-img :show="show" :img='img' @hide='hide'></view-img>

B.Single

// in your component
import {ViewImg} from 'img-view'
export default {
  components: {
    'view-img': ViewImg
  }
}

Properties

property required type default description
show true Boolean false if the model display
img true String '' the image url will show

Events

name required description
hide true the event for click the model, you can hide the model with this event

References

hammer

About

a component for mobile preview img with hammerjs. support move and zoom

https://newming.github.io/view-img


Languages

Language:Vue 74.4%Language:JavaScript 22.7%Language:HTML 2.9%