# vue-lazy-loader

> A lazy loading directive for vue.js

Latest version **3.0.3** (published 2021-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-lazy-loader
pnpm add vue-lazy-loader
yarn add vue-lazy-loader
bun add vue-lazy-loader
```

## 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 | 3.0.3 |
| Published | 2021-07-05 |
| First published | 2017-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jan Thoma |
| Maintainers | jan_thoma |
| Keywords | vue, lazy, loading, image |

## Links

- npm: https://www.npmjs.com/package/vue-lazy-loader
- Repository: https://github.com/t-k-f/vue-lazy-loader
- Homepage: https://github.com/t-k-f/vue-lazy-loader#readme
- Issues: https://github.com/t-k-f/vue-lazy-loader/issues
- npm.io page: https://npm.io/package/vue-lazy-loader

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 3.0.3 (latest) — 2021-07-05
- 3.0.2 — 2021-03-31
- 3.0.1 — 2020-10-16
- 3.0.0 — 2020-08-12
- 2.0.0 — 2019-05-10
- 1.5.1 — 2019-04-30
- 1.5.0 — 2018-11-08
- 1.4.0 — 2018-06-27
- 1.3.5 — 2018-06-25
- 1.3.4 — 2018-06-25
- 1.3.3 — 2018-06-01
- 1.3.2 — 2018-05-14
- 1.3.1 — 2018-05-08
- 1.3.0 — 2018-05-08
- 1.2.0 — 2018-05-07
- … 3 more at https://npm.io/package/vue-lazy-loader/versions

## README

# Vue.js Lazy loader plugin

A lazy loading directive for vue.js 3.x based on [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)

### Installing

```
npm install --save vue-lazy-loader
```

then

```
import VueLazyLoader from 'vue-lazy-loader'

createApp(App).use(VueLazyLoader, VueLazyLoader, { root: null, rootMargin: '0px', threshold: [0.75, 1] })
```

### Usage

```
<img v-lazy='/assets/img.jpg'> // set src

<div v-lazy='/assets/img.jpg'></div> // set background-image

<video v-lazy='/assets/img.jpg'></video> // set poster
```

### Scroll Reveal

Pictures are loaded on demand by when they are visible in the viewport. For possible option [see](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).

### Browser support

Support for IE11 was removed in Version 3.0.0 and above.
For supported browsers see [https://caniuse.com/#feat=intersectionobserver](https://caniuse.com/#feat=intersectionobserver)

### Vue.js 2x

Please install the package version @2.0.0

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