一个基于Vue.js2的图片浏览插件

1,281 阅读1分钟
原文链接: github.com

An image viewer base on Vue.js for mobile

0.9.1 function almost complete
0.9.3 β version release
0.9.7 code compression

🙆 Easy to use
👉 Swipe gesture
🔍 Zoom gesture

Please Use Mobile Browser 😆
live demo
or scan the QRcode

Install

npm i img-vuer --save

Usage

// import img-vuer and install
import gallery from 'img-vuer'
Vue.use(gallery)

// add direact to <img>
<img v-gallery :src="...">

// group images
<img v-gallery:groupName :src="...">
<img v-gallery:groupName :src="...">
<img v-gallery:groupName :src="...">

Development

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

Troubleshooting

abnormal with page scale Add meta

<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=0, maximum-scale=1">

License

MIT