@startselect/vue-lazyloader

0.1.2 • Public • Published

How to register this package in Vue?

First register this package within your vue instance like this:

import VueLazyLoader from '@startselect/vue-lazyloader';

Vue.use(VueLazyLoader);

Update the image tags

All the images that should be lazyloaded should be updated like this:

<img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-lazy-src="/original-image.png">

You can change data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== to anything else. We did this to load a blank image before this image becomes visible in the viewport.

Options

Available options:

Vue.use(VueLazyLoader, {
    offset: 150
});

Package Sidebar

Install

npm i @startselect/vue-lazyloader

Weekly Downloads

143

Version

0.1.2

License

MIT

Unpacked Size

3.61 kB

Total Files

3

Last publish

Collaborators

  • startselect