0.0.2 • Published 2 years ago

vue-pictures-viewer v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

vue-pictures-viewer

vue-pictures-viewer based on element-ui and iv-viewer

NPM version

Example

Live Example

Usage

1. Install

npm install vue-pictures-viewer element-ui --save
import PicturesViewer from 'vue-pictures-viewer';

export default {
  name: 'App',
  components: {
    PicturesViewer
  },
  data() {
    return {
      title: 'vue-pictures-viewer',
      images: [
        require('./assets/c1.jpg'),
        require('./assets/c2.jpg'),
        require('./assets/c3.jpg'),
        require('./assets/p1.jpg'),
        require('./assets/p2.jpg'),
        require('./assets/p3.jpg')
      ]
    };
  }
};

2. Template

<pictures-viewer :images="images" :options="options"></pictures-viewer>
参数说明类型默认值
[picturesViewer]外部样式类string-
[images]图片路径数组string[][]
[options]自定义配置options默认值
[showOperate]是否显示所有操作功能booleantrue
[zoom]是否显示放大缩小功能booleantrue
[rotate]是否显示旋转功能booleantrue
[reset]是否显示重置功能booleantrue
[fullscreen]是否显示全屏功能booleantrue
[download]是否显示下载功能booleantrue
[defaultName]图片下载文件前缀stringdownload

options

参数说明类型默认值
ivViewerOptionsiv-viewer全局配置,见OptionsIvViewerType-
imageViewOptions功能提示全局配置,见imageViewOptionsimageViewOptions-

imageViewOptions

参数说明类型默认值
zoomInToolTip放大功能提示string放大
zoomOutToolTip缩小功能提示string缩小
rotateLeftToolTip逆时针功能旋转提示string逆时针旋转
rotateRightToolTip顺时针功能提示string顺时针旋转
resetToolTip重置功能提示string重置
fullScreenToolTip全屏功能提示string全屏
downloadToolTip下载功能提示string下载

Events

事件名称说明回调参数
prevChange切换上一张回调函数(e: number)
nextChange切换下一张回调函数(e: number)

License

The MIT License (see the LICENSE file for the full text)