2.0.1 • Published 4 years ago

kuan-vue-photoswipe v2.0.1

Weekly downloads
6
License
ISC
Repository
github
Last release
4 years ago

kuan-vue-photoswipe

使用 vue3.0 简单包装一下photoSwipe

图片预览只需要一行代码 预览地址

安装

yarn add kuan-vue-photoswipe

使用

引入

import Vue from 'vue'
import photoSwipe from 'kuan-vue-photoswipe'

Vue.use(photoSwipe)

// 全局注入使用
this.$preview(
  'https://www.google.com.hk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
)

多张预览

import photoSwipe from 'kuan-vue-photoswipe'
/**
 * 多组图片预览
 * @param {Array} images [{src: '', w: '', h: '', title: ''}] === 图片数组
 * @param {Object} options {index: 0, history: false, change: function} === 预览下标、显示hash(hash路由冲突)、change
 */
photoSwipe.preview(this.images, { index: 1, change: this.callback })
2.0.1

4 years ago

2.0.0

4 years ago

1.0.7

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago