Image viewer never been that easy to setup. 🌁
Browser | Minimum version |
---|---|
Firefox (desktop) | ❓ |
Chrome (desktop) | ❓ |
Safari (desktop) | ❓ |
Opera (desktop) | ❓ |
Firefox (mobile) | ❓ |
Chrome (mobile) | ❓ |
Safari (mobile) | ❓ |
Opera mini (mobile) | ❓ |
Will be filled soon.
- Install plugin with yarn or npm
yarn add v-img
or
npm install v-img --save
- Use plugin before creating Vue instance
import Vue from 'vue';
import VueImg from 'v-img';
Vue.use(VueImg);
new Vue({...})
- Add
v-img
directive to the image
<img v-img src="...">
To open only one image don't specify any directive argument:
<img v-img src="...">
To specify groups of images (to be able to scroll around them when opened, show counter in top left corner) add similar argument to directives:
<img v-img:name src="...">
<img v-img:name src="...">
There are some available options we can specify as value of the directive:
<img v-img="{...}" src="...">
Option | Description | Default value |
---|---|---|
src | Source of image will be displayed | src attribute from html tag |
cursor | Cursor when hovering original <img> |
'pointer' |
- Preload all custom soruces of opened group
- Always show control bottons on mobiles
- Add tests