1.0.1 • Published 4 years ago

van-preview v1.0.1

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

van-preview

一个图片语言的 Vue 插件。

Install

yarn add van-preview

Use

import Vue from 'vue'
import VanPreview from 'van-preview'

Vue.use(VanPreview)

Methods

this.$imagePreview(options = {})

options有三个参数

参数默认值说明
images空数组图片的url数组
index0预览图片的索引值, 默认是0
defaultOpt{}配置项

defaultOpt 的配置项请参考photoswipe配置项

defaultOpt: {
  fullscreenEl: true,
  shareEl: false,
  arrowEl: true,
  preloaderEl: true,
  loop: false,
  bgOpacity: 0.85,
  showHideOpacity: true,
  errorMsg: '<div class="pswp__error-msg">图片加载失败</div>',
}