# kuan-vue-photoswipe

> vue3.0 + photoswipe

Latest version **2.0.1** (published 2020-11-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install kuan-vue-photoswipe
pnpm add kuan-vue-photoswipe
yarn add kuan-vue-photoswipe
bun add kuan-vue-photoswipe
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-11-01 |
| First published | 2018-10-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | luzhongk@126.com |
| Maintainers | luzhongk |
| Keywords | photoswipe, vue3.0 |

## Links

- npm: https://www.npmjs.com/package/kuan-vue-photoswipe
- Repository: https://github.com/kuan1/kuan-vue-photoswipe
- Homepage: https://github.com/kuan1/kuan-vue-photoswipe#readme
- Issues: https://github.com/kuan1/kuan-vue-photoswipe/issues
- npm.io page: https://npm.io/package/kuan-vue-photoswipe

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^3.0.0
- [core-js](https://npm.io/package/core-js.md) ^3.6.5

## Recent versions

- 2.0.1 (latest) — 2020-11-01
- 2.0.0 — 2020-10-26
- 1.0.7 — 2020-07-29
- 1.0.6 — 2019-05-09
- 1.0.5 — 2019-05-09
- 1.0.4 — 2019-02-24
- 1.0.3 — 2019-02-24
- 1.0.2 — 2018-12-21
- 1.0.1 — 2018-10-24
- 1.0.0 — 2018-10-24

## README

# [kuan-vue-photoswipe](https://github.com/kuan1/kuan-vue-photoswipe)

使用 `vue3.0` 简单包装一下[photoSwipe](https://github.com/dimsemenov/PhotoSwipe)

图片预览只需要一行代码 [预览地址](https://kuan1.github.io/kuan-vue-photoswipe)

## 安装

```bash
yarn add kuan-vue-photoswipe
```

## 使用

#### 引入

```javascript
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'
)
```

### 多张预览

```javascript
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 })
```

---
_Source: https://npm.io/package/kuan-vue-photoswipe · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
