vue2-viewer
vue2-viewer 是一款强大的图像浏览插件,可以实现图像的放大预览,旋转,任意比例放大和缩小等功能
vue2-viewer 是viewer.js vue的实现,效果以及样式完全移植自viewer.js关于viewer.js可以参考链接
[http://fengyuanchen.github.io...]
插件中所有的效果均大量地使用了css3的新特性替换了viewer.js中的js动画,所以vue2-viewer主要实用场景是现代浏览器中。
使用文档
安装
npm install --save vue2-viewer
在main.js中引入并使用插件
import ImageViewer from 'vue2-viewer';
Vue.use(ImageViewer);
插件会在全局注册vue-viewer组件
使用组件
vue2-viewer 提供两种使用模式,单图片模式和多图列表模式。
单图片模式
props
参数
说明
类型
必须
thumb
要显示的小图的链接
string
true
full
点击放大后的大图链接
string
true
示例:
:thumb="image"
:full="image">
export default {
name: 'app',
<