Image viewer component for vue, supports rotation, scale, zoom and so on, based on viewer.js
Install from GitHub via NPM
npm install v-viewer
v-viewer, simply import it, and call
Vue.use() to install.
<!-- directive -->...<!-- component -->
var VueViewer =
Just add the directive
v-viewer to any element, then all
img elements in it will be handled by
You can set the options like this:
Get the element by selector and then use
el.$viewer to get the
viewer instance if you need.
You can simply import the component and register it locally too.
Use scoped slot to customize the presentation of your images.
Listen for the
inited event to get the
viewer instance, or use
Refer to viewer.js.
If you need to avoid name conflict, you can import it like this:
If you need to set the viewer default options, you can import it like this:
And you can reset the default options at any other time: