van-preview

1.0.1 • Public • Published

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数组
index 0 预览图片的索引值, 默认是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>',
}

Readme

Keywords

Package Sidebar

Install

npm i van-preview

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

12 kB

Total Files

10

Last publish

Collaborators

  • vanoneang